s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
AnimationState
chevron_left Classes
class
AnimationState

Constructors

functionsAnimationState

Fields

crop_dinCurrentFrameIndexcrop_dinIsPingPongingcrop_dinPlaybackSpeedcrop_dinTimeSinceLastFrame

Properties

data_objectJustFinished

Methods

functionsResetStatefunctionsTryAdvanceFrame
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.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter