Inheritence

Summary

Renders a sprite in the world

Constructors

SpriteRenderer

Properties

Additive Whether or not the sprite should be rendered additively.
Billboard Alignment mode for the sprite's billboard behavior.
Color The color of the sprite. This is multiplied with the texture color.
ComponentVersion
CurrentAnimation The animation that is currently being played. Returns null if no sprite is set or the sprite has no animations.
CurrentFrameIndex 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.
DepthFeather Amount of feathering applied to the depth, softening its intersection with geometry.
FlipHorizontal Whether or not the sprite should be flipped horizontally.
FlipVertical Whether or not the sprite should be flipped vertically.
FogStrength The strength of the fog effect applied to the sprite. This determines how much the sprite blends with any fog in the scene.
IsAnimated Whether or not the sprite is animated. This is true if the sprite has more than one animation or if the current animation has more than one frame.
IsSorted 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.
Lighting Whether or not the sprite should be lit by the scene's lighting system. Otherwise it will be unlit/fullbright.
Opaque Whether or not the sprite should be rendered opaque. If true, any semi-transparent pixels will be dithered.
PlaybackSpeed The playback speed of the animation. 0 is paused, and negative values will play the animation in reverse.
Shadows Whether or not the sprite should cast shadows.
Size The width and height of the sprite in world units.
Sprite The sprite resource to render. This can be completely static or contain animation(s).
StartingAnimationName The animation that this sprite should start playing when the scene starts.
Texture The texture of the current frame being displayed. Returns a transparent texture when no valid frame is available.
TextureFilter The texture filtering mode used when rendering the sprite. For pixelated sprites, use Sandbox.UI.ImageRendering.Point.

Methods

PlayAnimation Play an animation by index (the first animation is index 0).
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.