CanvasItemMaterial
A material for CanvasItem
s.
class CanvasItemMaterial
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
.
Superclasses
class Material
Virtual base class for applying visual properties to an object, such as color and roughness.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var blendMode: CanvasItemMaterial.BlendMode
The manner in which a material’s rendering is applied to underlying textures.
var lightMode: CanvasItemMaterial.LightMode
The manner in which material reacts to lighting.
var particlesAnimHFrames: Int32
The number of columns in the spritesheet assigned as
Texture2D
for aGPUParticles2D
orCPUParticles2D
.var particlesAnimLoop: Bool
If
true
, the particles animation will loop.var particlesAnimVFrames: Int32
The number of rows in the spritesheet assigned as
Texture2D
for aGPUParticles2D
orCPUParticles2D
.var particlesAnimation: Bool
If
true
, enable spritesheet-based animation features when assigned toGPUParticles2D
andCPUParticles2D
nodes. TheanimSpeedMax
oranimSpeedMax
should also be set to a positive value for the animation to play.