SpriteRendererclass
Renders a sprite in the world
Constructors1
Showing 1 constructors
public SpriteRenderer()
No results match this filter.
Methods2
Showing 2 methods
No results match this filter.
Properties31
Showing 31 properties
public virtual sealed bool Sandbox.SpriteRenderer.Additive { get; set; }
Whether or not the sprite should be rendered additively.
bool—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.
float—public Sandbox.SpriteRenderer.BillboardMode Sandbox.SpriteRenderer.Billboard { get; set; }
Alignment mode for the sprite's billboard behavior.
public float Sandbox.SpriteRenderer.CameraFadeFar { get; set; }
Sprites further from the camera than this are fully opaque. Between this and `Sandbox.SpriteRenderer.CameraFadeNear` they fade out. Leave at zero to disable the fade.
float—public float Sandbox.SpriteRenderer.CameraFadeNear { get; set; }
Sprites closer to the camera than this are completely invisible.
float—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; }
int—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.
int—public float Sandbox.SpriteRenderer.DepthFeather { get; set; }
Amount of feathering applied to the depth, softening its intersection with geometry.
float—public bool Sandbox.SpriteRenderer.FlipHorizontal { get; set; }
Whether or not the sprite should be flipped horizontally.
bool—public bool Sandbox.SpriteRenderer.FlipVertical { get; set; }
Whether or not the sprite should be flipped vertically.
bool—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.
float—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.
bool—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.
bool—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.
bool—public Sandbox.Texture Sandbox.SpriteRenderer.NormalTexture { get; set; }
Tangent-space normal map sampled in linear space, using the same UV layout as the sprite texture. Sprite flips and rotation also transform the normal. The map is shared by all animation frames.
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.
Action<string>—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.
Action<string>—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.
Action<string>—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.
bool—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.
float—public bool Sandbox.SpriteRenderer.Refraction { get; set; }
Draw the sprite artwork over a refracted background in one pass. Alpha controls the artwork only. Requires a normal texture and translucent, non-additive rendering. The captured scene is already lit and fogged.
bool—public float Sandbox.SpriteRenderer.RefractionStrength { get; set; }
Maximum refraction offset in render pixels before the normal is applied. Alpha, depth feathering and camera fading affect artwork opacity only, never the refraction. Zero leaves the background undistorted.
float—public virtual sealed bool Sandbox.SpriteRenderer.Shadows { get; set; }
Whether or not the sprite should cast shadows.
bool—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.
string—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.