梯度

Inherits: Resource < Reference < Object

类别: 核心

简要说明

一种颜色插补器资源,可用于在用户定义的颜色点之间生成颜色。

属性

PoolColorArray

colors

池颜色数组(0,0,0,1,1,1,1,1,1)

PoolRealArray

offsets

PoolRealArray(0,1)

方法

无效

add_point ( float offset, Color color )

Color

get_color ( int point ) const

float

get_offset ( int point ) const

int

get_point_count ( ) const

Color

interpolate ( float offset )

无效

remove_point ( int offset )

无效

set_color ( int point, Color color )

无效

set_offset ( int point, float offset )

描述

给定一组颜色,此资源将按顺序插入它们。这意味着,如果有颜色1、颜色2和颜色3,渐变将从颜色1插入到颜色2,并从颜色2插入到颜色3。渐变最初将有两种颜色(黑色和白色),一种(黑色)在渐变较低偏移量0处,另一种(白色)在渐变较高偏移量1处。

属性描述

违约

池颜色数组(0,0,0,1,1,1,1,1,1)

设定器

设置颜色(值)

吸气剂

获取颜色()

渐变的颜色作为 PoolColorArray .

违约

PoolRealArray(0,1)

设定器

设置偏移(值)

吸气剂

获取偏移量()

渐变的偏移返回为 PoolRealArray .

方法说明

使用指定的偏移量将指定的颜色添加到渐变的末端。

返回索引处渐变颜色的颜色 point .

返回渐变颜色在索引处的偏移量 point .

  • int get_point_count ( ) const

返回渐变中的颜色数。

返回由指定的内插颜色 offset .

  • void remove_point ( int offset )

删除索引处的颜色 offset .

  • void set_color ( int point, Color color )

在索引处设置渐变颜色的颜色 point .

  • void set_offset ( int point, float offset )

在索引处设置渐变颜色的偏移量 point .