- Properties related to the
Sprite
module.
Static variables
staticread onlyanimation:Property<Hash> = new Property<Hash>("animation")
- The current animation id. An animation that plays currently for the sprite.
READ ONLY
staticread onlycursor:Property<Float> = new Property<Float>("cursor")
- The normalized animation cursor.
staticread onlyframe_count:Property<Int> = new Property<Int>("frame_count")
- The frame count of the currently playing animation.
READ ONLY
staticread onlyimage:Property<TextureResourceReference> = new Property<TextureResourceReference>("image")
- The image used when rendering the sprite.
You can set/get the image for a specific sampler by passing an options table with a key
field to go.set
/go.get
:
- go.set("#sprite", "image", myAtlas, { key: "tex1" })
- var current = go.get("#sprite", "image", { key: "tex1" })
staticread onlymaterial:Property<MaterialResourceReference> = new Property<MaterialResourceReference>("material")
- The material used when rendering the sprite.
staticread onlyplayback_rate:Property<Float> = new Property<Float>("playback_rate")
- The animation playback rate. A multiplier to the animation playback rate.
The playback_rate is a non-negative number, a negative value will be clamped to 0.
staticread onlyscale:Property<Vector3> = new Property<Vector3>("scale")
- The non-uniform scale of the sprite.
staticread onlyscaleX:Property<Float> = new Property<Float>("scale.x")
- The non-uniform scale of the sprite on the x-axis.
staticread onlyscaleY:Property<Float> = new Property<Float>("scale.y")
- The non-uniform scale of the sprite on the y-axis.
staticread onlysize:Property<Vector3> = new Property<Vector3>("size")
- The size of the sprite, not allowing for any additional scaling that may be applied. The type of the property is vector3. It is not possible to set the size if the size mode of the sprite is set to auto.
staticread onlysizeX:Property<Float> = new Property<Float>("size.x")
- The width of the sprite, not allowing for any additional scaling that may be applied.
staticread onlysizeY:Property<Float> = new Property<Float>("size.y")
- The height of the sprite, not allowing for any additional scaling that may be applied.
staticread onlyslice:Property<Vector4> = new Property<Vector4>("slice")
- The slice values of the sprite. The type of the property is a vector4 that corresponds to the left, top, right, bottom values of the sprite in the editor. It is not possible to set the slice property if the size mode of the sprite is set to auto.