s&box docs

public sealed class Sandbox.Sprite : Sandbox.GameResource

Represents a sprite resource that can be static or animated. Sprites are rendererd using the SpriteRenderer component.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 5 methods

public static Sandbox.Sprite FromTexture(Sandbox.Texture texture)

Returns a sprite with a single frame animation using the provided texture.

Parameters

  • texture: The texture to be used

public static Sandbox.Sprite FromTextures(System.Collections.Generic.IEnumerable`1<Sandbox.Texture> textures, float frameRate = 15)

Parameters

  • frameRate: Default: 15

public int GetAnimationIndex(string name)

Get the index of an animation by its name. Returns -1 if not found.

Parameters

  • name: The name of the animation

Properties

Showing 1 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.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Sprite

On this page