API ReferenceSandbox
Spriteclass
Represents a sprite resource that can be static or animated. Sprites are rendererd using the SpriteRenderer component.
Constructors1
Showing 1 constructors
public Sprite()
No results match this filter.
Methods5
Showing 5 methods
public static Sandbox.Sprite FromTexture(Sandbox.Texture texture)
Returns a sprite with a single frame animation using the provided texture.
| Parameter | Type | Description |
|---|---|---|
| texture | Texture | The texture to be used |
public static Sandbox.Sprite FromTextures(System.Collections.Generic.IEnumerable`1<Sandbox.Texture> textures, float frameRate = 15)
| Parameter | Type | Description |
|---|---|---|
| textures | IEnumerable<Texture> | — |
| frameRate = 15 | float | — |
public int GetAnimationIndex(string name)
Get the index of an animation by its name. Returns -1 if not found.
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the animation |
Returns:
int—No results match this filter.
Properties2
Showing 2 properties
public System.Collections.Generic.List`1<Sandbox.Sprite.Animation> Sandbox.Sprite.Animations { get; set; }
A list of animations that can be played. Some animations can consist of multiple frames. If a sprite is static, it will only contain a single default animation.
public virtual int Sandbox.Sprite.ResourceVersion { get; set; }
Returns:
int—No results match this filter.