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
AnimationState
chevron_left
Classes
class
AnimationState
Constructors
functions
AnimationState
Fields
crop_din
CurrentFrameIndex
crop_din
IsPingPonging
crop_din
PlaybackSpeed
crop_din
TimeSinceLastFrame
Properties
data_object
JustFinished
Methods
functions
ResetState
functions
TryAdvanceFrame
AnimationState
Contains the state of a sprite instance's animation playback.
class
Sandbox.Sprite
.
Sandbox.Engine
build
Constructors
1
AnimationState
(
)
crop_din
Fields
4
CurrentFrameIndex
int
The current frame index in the animation.
IsPingPonging
bool
Whether or not the animation is currently ping-ponging. This is only relevant for animations that have Sandbox.Sprite.LoopMode.PingPong
PlaybackSpeed
float
The speed at which the animation is playing back. A value of 1 means normal speed, 0.5 means half speed, and -1 means reverse playback.
TimeSinceLastFrame
float
The time since the last frame was advanced.
data_object
Properties
1
JustFinished
bool
Returns true if the animation finished, looped, or ping-ponged after calling Sandbox.Sprite.AnimationState.TryAdvanceFrame(Sandbox.Sprite.Animation,System.Single)
functions
Methods
2
ResetState
(
)
Reset the animation playback state to the beginning (first frame, no ping-pong, zero time-since).
TryAdvanceFrame
(
animation
,
deltaTime
)
bool
Try to advance the frame of a given animation with a given delta time. Returns false if the frame did not advance.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.