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
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
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
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
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.