Struct CanvasItemMaterial

A material for CanvasItems.

struct CanvasItemMaterial ;

CanvasItemMaterials 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.

Properties

NameTypeDescription
blendMode[get, set] CanvasItemMaterial.BlendModeThe manner in which a material's rendering is applied to underlying textures.
lightMode[get, set] CanvasItemMaterial.LightModeThe manner in which material reacts to lighting.
particlesAnimation[get, set] boolIf true, enable spritesheet-based animation features when assigned to Particles2D and CPUParticles2D nodes. The ParticlesMaterial.animSpeed or CPUParticles2D.animSpeed 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.
particlesAnimHFrames[get, set] longThe number of columns in the spritesheet assigned as Texture for a Particles2D or CPUParticles2D. Note: This property is only used and visible in the editor if particlesAnimation is true.
particlesAnimLoop[get, set] boolIf true, the particles animation will loop. Note: This property is only used and visible in the editor if particlesAnimation is true.
particlesAnimVFrames[get, set] longThe number of rows in the spritesheet assigned as Texture for a Particles2D or CPUParticles2D. Note: This property is only used and visible in the editor if particlesAnimation is true.

Methods

NameDescription
getBlendMode
getLightMode
getParticlesAnimation
getParticlesAnimHFrames
getParticlesAnimLoop
getParticlesAnimVFrames
setBlendMode
setLightMode
setParticlesAnimation
setParticlesAnimHFrames
setParticlesAnimLoop
setParticlesAnimVFrames

Enums

NameDescription
BlendMode
Constants
LightMode