public sealed class Sandbox.SpriteRenderer : Sandbox.Renderer
Renders a sprite in the world
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
public SpriteRenderer()
No results match this filter.
Methods
Showing 2 methods
No results match this filter.
Properties
Showing 26 properties
public virtual sealed bool Sandbox.SpriteRenderer.Additive { get; set; }
Whether or not the sprite should be rendered additively.
public float Sandbox.SpriteRenderer.AlphaCutoff { get; set; }
Alpha threshold for discarding pixels. Pixels with alpha below this value will be discarded. Only used when Opaque is true. Range: 0.0 (transparent) to 1.0 (opaque). Default is 0.5.
public Sandbox.SpriteRenderer.BillboardMode Sandbox.SpriteRenderer.Billboard { get; set; }
Alignment mode for the sprite's billboard behavior.
public Color Sandbox.SpriteRenderer.Color { get; set; }
The color of the sprite. This is multiplied with the texture color.
public virtual int Sandbox.SpriteRenderer.ComponentVersion { get; set; }
public Sandbox.Sprite.Animation Sandbox.SpriteRenderer.CurrentAnimation { get; set; }
The animation that is currently being played. Returns null if no sprite is set or the sprite has no animations.
public int Sandbox.SpriteRenderer.CurrentFrameIndex { get; set; }
The index of the current frame being displayed. This will change over time if the sprite is animated, and can be set to go to a specific frame even during playback.
public float Sandbox.SpriteRenderer.DepthFeather { get; set; }
Amount of feathering applied to the depth, softening its intersection with geometry.
public bool Sandbox.SpriteRenderer.FlipHorizontal { get; set; }
Whether or not the sprite should be flipped horizontally.
public bool Sandbox.SpriteRenderer.FlipVertical { get; set; }
Whether or not the sprite should be flipped vertically.
public float Sandbox.SpriteRenderer.FogStrength { get; set; }
The strength of the fog effect applied to the sprite. This determines how much the sprite blends with any fog in the scene.
public bool Sandbox.SpriteRenderer.IsAnimated { get; set; }
Whether or not the sprite is animated. This is true if the sprite has more than one animation.
public virtual sealed bool Sandbox.SpriteRenderer.IsSorted { get; set; }
Whether or not the sprite should be sorted by depth. If the sprite is opaque, this can be turned off for a performance boost if not needed.
public bool Sandbox.SpriteRenderer.Lighting { get; set; }
Whether or not the sprite should be lit by the scene's lighting system. Otherwise it will be unlit/fullbright.
public System.Action`1<string> Sandbox.SpriteRenderer.OnAnimationEnd { get; set; }
This action is invoked when an animation finishes playing or has looped. The string parameter is the name of the animation.
public System.Action`1<string> Sandbox.SpriteRenderer.OnAnimationStart { get; set; }
This action is invoked when an animation starts playing. The string parameter is the name of the animation that started.
public System.Action`1<string> Sandbox.SpriteRenderer.OnBroadcastMessage { get; set; }
This action is invoked when advancing to a new frame that has broadcast messages. The string parameter is the message being broadcast.
public virtual sealed bool Sandbox.SpriteRenderer.Opaque { get; set; }
Whether or not the sprite should be rendered opaque. If true, any semi-transparent pixels will be dithered.
public Color Sandbox.SpriteRenderer.OverlayColor { get; set; }
public float Sandbox.SpriteRenderer.PlaybackSpeed { get; set; }
The playback speed of the animation. 0 is paused, and negative values will play the animation in reverse.
public virtual sealed bool Sandbox.SpriteRenderer.Shadows { get; set; }
Whether or not the sprite should cast shadows.
public Vector2 Sandbox.SpriteRenderer.Size { get; set; }
The width and height of the sprite in world units.
public Sandbox.Sprite Sandbox.SpriteRenderer.Sprite { get; set; }
The sprite resource to render. This can be completely static or contain animation(s).
public string Sandbox.SpriteRenderer.StartingAnimationName { get; set; }
The animation that this sprite should start playing when the scene starts.
public Sandbox.Texture Sandbox.SpriteRenderer.Texture { get; set; }
The texture of the current frame being displayed. Returns a transparent texture when no valid frame is available.
public Sandbox.Rendering.FilterMode Sandbox.SpriteRenderer.TextureFilter { get; set; }
The texture filtering mode used when rendering the sprite. For pixelated sprites, use `Sandbox.UI.ImageRendering.Point`.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.SpriteRenderer |