Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

CanvasItemMaterial

0 0 vote
Article Rating

Inherits: Material < Resource < Reference < Object

A material for CanvasItems.

Description

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.

Enumerations

enum BlendMode:

  • BLEND_MODE_MIX = 0 — Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
  • BLEND_MODE_ADD = 1 — Additive blending mode.
  • BLEND_MODE_SUB = 2 — Subtractive blending mode.
  • BLEND_MODE_MUL = 3 — Multiplicative blending mode.
  • BLEND_MODE_PREMULT_ALPHA = 4 — Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.

enum LightMode:

  • LIGHT_MODE_NORMAL = 0 — Render the material using both light and non-light sensitive material properties.
  • LIGHT_MODE_UNSHADED = 1 — Render the material as if there were no light.
  • LIGHT_MODE_LIGHT_ONLY = 2 — Render the material as if there were only light.

Property Descriptions

Default0
Setterset_blend_mode(value)
Getterget_blend_mode()

The manner in which a material’s rendering is applied to underlying textures.


Default0
Setterset_light_mode(value)
Getterget_light_mode()

The manner in which material reacts to lighting.


  • int particles_anim_h_frames
Setterset_particles_anim_h_frames(value)
Getterget_particles_anim_h_frames()

The 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 particles_animation is true.


  • bool particles_anim_loop
Setterset_particles_anim_loop(value)
Getterget_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
Setterset_particles_anim_v_frames(value)
Getterget_particles_anim_v_frames()

The 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 particles_animation is true.


  • bool particles_animation
Defaultfalse
Setterset_particles_animation(value)
Getterget_particles_animation()

If true, enable spritesheet-based animation features when assigned to Particles2D and CPUParticles2D nodes. The ParticlesMaterial.anim_speed or CPUParticles2D.anim_speed 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.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x