s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
voting
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
Voting is open. Play the entries and pick the winner.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Classes
SpriteInstance
chevron_left
Classes
class
SpriteInstance
Constructors
functions
SpriteInstance
Properties
data_object
Animation
data_object
CurrentFrameIndex
data_object
Frame
data_object
IsFinished
data_object
Paused
data_object
PlaybackSpeed
data_object
Sprite
data_object
Texture
Methods
functions
Play
functions
Update
SpriteInstance
A sprite resource with independent animation playback. Call Update once per update, then draw the current frame as many times as needed with Painter.Sprite.
class
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
SpriteInstance
(
sprite
)
Creates independent playback starting at the sprite's first animation.
data_object
Properties
8
Animation
Animation
The selected animation, or null when none is available.
CurrentFrameIndex
int
The current frame index. Setting it clears elapsed frame time and completion state. An out-of-range index has no frame to draw.
Frame
Frame
The current frame, or null when no valid frame is selected.
IsFinished
bool
True after a non-looping animation has finished. Cleared by switching, restarting or seeking.
Paused
bool
Pauses advancement without discarding elapsed frame time.
PlaybackSpeed
float
Playback multiplier. Zero stops advancement; negative values play backwards.
Sprite
Sprite
The sprite to play. Changing it selects its first animation and resets playback. A null sprite has no frame to draw.
Texture
Texture
The current frame's texture, or null when no texture is available.
functions
Methods
2
Play
(
animation
,
restart
)
Selects an animation by name and resumes playback. Playing the selected animation preserves its position unless restart is true. An unknown name leaves playback unchanged.
Update
(
deltaTime
)
Advances playback by elapsed seconds, respecting the animation's frame rate and loop points. Drawing does not call this method. Frame broadcast actions are not executed by this instance.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.