s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
SpriteRenderer
chevron_left
Classes
class
SpriteRenderer
search
Constructors
functions
SpriteRenderer
Properties
data_object
Additive
data_object
AlphaCutoff
data_object
Billboard
data_object
Color
data_object
ComponentVersion
data_object
CurrentAnimation
data_object
CurrentFrameIndex
data_object
DepthFeather
data_object
FlipHorizontal
data_object
FlipVertical
data_object
FogStrength
data_object
IsAnimated
data_object
IsSorted
data_object
Lighting
data_object
OnAnimationEnd
data_object
OnAnimationStart
data_object
OnBroadcastMessage
data_object
Opaque
data_object
OverlayColor
data_object
PlaybackSpeed
data_object
Shadows
data_object
Size
data_object
Sprite
data_object
StartingAnimationName
data_object
Texture
data_object
TextureFilter
Methods
functions
PlayAnimation
menu
SpriteRenderer
Renders a sprite in the world
class
Sandbox
.
account_tree
extends
Renderer
sealed
Sandbox.Engine
build
Constructors
1
SpriteRenderer
(
)
data_object
Properties
26
Additive
bool
Whether or not the sprite should be rendered additively.
AlphaCutoff
float
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.
Billboard
BillboardMode
Alignment mode for the sprite's billboard behavior.
Color
Color
The color of the sprite. This is multiplied with the texture color.
ComponentVersion
int
CurrentAnimation
Animation
The animation that is currently being played. Returns null if no sprite is set or the sprite has no animations.
CurrentFrameIndex
int
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
float
Amount of feathering applied to the depth, softening its intersection with geometry.
FlipHorizontal
bool
Whether or not the sprite should be flipped horizontally.
FlipVertical
bool
Whether or not the sprite should be flipped vertically.
FogStrength
float
The strength of the fog effect applied to the sprite. This determines how much the sprite blends with any fog in the scene.
IsAnimated
bool
Whether or not the sprite is animated. This is true if the sprite has more than one animation.
IsSorted
bool
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
bool
Whether or not the sprite should be lit by the scene's lighting system. Otherwise it will be unlit/fullbright.
OnAnimationEnd
Action`1
This action is invoked when an animation finishes playing or has looped. The string parameter is the name of the animation.
OnAnimationStart
Action`1
This action is invoked when an animation starts playing. The string parameter is the name of the animation that started.
OnBroadcastMessage
Action`1
This action is invoked when advancing to a new frame that has broadcast messages. The string parameter is the message being broadcast.
Opaque
bool
Whether or not the sprite should be rendered opaque. If true, any semi-transparent pixels will be dithered.
OverlayColor
Color
PlaybackSpeed
float
The playback speed of the animation. 0 is paused, and negative values will play the animation in reverse.
Shadows
bool
Whether or not the sprite should cast shadows.
Size
Vector2
The width and height of the sprite in world units.
Sprite
Sprite
The sprite resource to render. This can be completely static or contain animation(s).
StartingAnimationName
string
The animation that this sprite should start playing when the scene starts.
Texture
Texture
The texture of the current frame being displayed. Returns a transparent texture when no valid frame is available.
TextureFilter
FilterMode
The texture filtering mode used when rendering the sprite. For pixelated sprites, use Sandbox.UI.ImageRendering.Point.
functions
Methods
1
PlayAnimation
(
index
)
Play an animation by index (the first animation is index 0).
Inheritance
Component
Renderer
SpriteRenderer
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.