• Properties related to the Sprite module.

Static variables

@:value(new Property<Hash>("animation"))staticread onlyanimation:Property<Hash> = new Property<Hash>("animation")

  • The current animation id. An animation that plays currently for the sprite.

READ ONLY

@:value(new Property<Float>("cursor"))staticread onlycursor:Property<Float> = new Property<Float>("cursor")

  • The normalized animation cursor.

@:value(new Property<Int>("frame_count"))staticread onlyframe_count:Property<Int> = new Property<Int>("frame_count")

  • The frame count of the currently playing animation.

READ ONLY

@:value(new Property<TextureResourceReference>("image"))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" })

@:value(new Property<MaterialResourceReference>("material"))staticread onlymaterial:Property<MaterialResourceReference> = new Property<MaterialResourceReference>("material")

  • The material used when rendering the sprite.

@:value(new Property<Float>("playback_rate"))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.

@:value(new Property<Vector3>("scale"))staticread onlyscale:Property<Vector3> = new Property<Vector3>("scale")

  • The non-uniform scale of the sprite.

@:value(new Property<Float>("scale.x"))staticread onlyscaleX:Property<Float> = new Property<Float>("scale.x")

  • The non-uniform scale of the sprite on the x-axis.

@:value(new Property<Float>("scale.y"))staticread onlyscaleY:Property<Float> = new Property<Float>("scale.y")

  • The non-uniform scale of the sprite on the y-axis.

@:value(new Property<Vector3>("size"))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.

@:value(new Property<Float>("size.x"))staticread onlysizeX:Property<Float> = new Property<Float>("size.x")

  • The width of the sprite, not allowing for any additional scaling that may be applied.

@:value(new Property<Float>("size.y"))staticread onlysizeY:Property<Float> = new Property<Float>("size.y")

  • The height of the sprite, not allowing for any additional scaling that may be applied.

@:value(new Property<Vector4>("slice"))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.