CanvasItemMaterial
继承: Material
< Resource
< RefCounted
< Object
A material for CanvasItem
s.
描述
CanvasItemMaterial s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a ShaderMaterial
to more fully customize a material's interactions with a CanvasItem
.
属性
BlendMode | blend_mode |
LightMode | light_mode |
int | particles_anim_h_frames |
bool | particles_anim_loop |
int | particles_anim_v_frames |
bool | particles_animation |
枚举
enum BlendMode:
BlendMode BLEND_MODE_MIX = 0
Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
BlendMode BLEND_MODE_ADD = 1
Additive blending mode.
BlendMode BLEND_MODE_SUB = 2
Subtractive blending mode.
BlendMode BLEND_MODE_MUL = 3
Multiplicative blending mode.
BlendMode BLEND_MODE_PREMULT_ALPHA = 4
Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
enum LightMode:
LightMode LIGHT_MODE_NORMAL = 0
Render the material using both light and non-light sensitive material properties.
LightMode LIGHT_MODE_UNSHADED = 1
Render the material as if there were no light.
LightMode LIGHT_MODE_LIGHT_ONLY = 2
Render the material as if there were only light.
属性说明
BlendMode blend_mode = 0
The manner in which a material's rendering is applied to underlying textures.
LightMode light_mode = 0
The manner in which material reacts to lighting.
int
particles_anim_h_frames
The number of columns in the spritesheet assigned as Texture2D
for a GPUParticles2D
or CPUParticles2D
.
Note: This property is only used and visible in the editor if particles_animation
is true
.
bool
particles_anim_loop
If true
, the particles animation will loop.
Note: This property is only used and visible in the editor if particles_animation
is true
.
int
particles_anim_v_frames
The number of rows in the spritesheet assigned as Texture2D
for a GPUParticles2D
or CPUParticles2D
.
Note: This property is only used and visible in the editor if particles_animation
is true
.
bool
particles_animation = false
If true
, enable spritesheet-based animation features when assigned to GPUParticles2D
and CPUParticles2D
nodes. The ParticleProcessMaterial.anim_speed_max
or CPUParticles2D.anim_speed_max
should also be set to a positive value for the animation to play.
This property (and other particles_anim_*
properties that depend on it) has no effect on other types of nodes.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。