MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / ChangeState

Method ChangeState

utilities/olcUTIL_Animate2D.h:198–210  ·  view source on GitHub ↗

Change an animation state token to a new state

Source from the content-addressed store, hash-verified

196
197 // Change an animation state token to a new state
198 inline bool ChangeState(AnimationState& state, const StatesEnum& sStateName) const
199 {
200 size_t idx = m_mapStateIndices.at(sStateName);
201 if (state.nIndex != idx)
202 {
203 state.fTime = 0.0f;
204 state.nIndex = idx;
205 state.bComplete = false;
206 return true;
207 }
208
209 return false;
210 }
211
212 // Update an animation state token
213 inline void UpdateState(AnimationState& state, const float fElapsedTime) const

Callers 2

OnUserCreateMethod · 0.80
OnUserUpdateMethod · 0.80

Calls

no outgoing calls

Tested by 2

OnUserCreateMethod · 0.64
OnUserUpdateMethod · 0.64