Click or drag to resize
SpriteBaseCalculateRotatedState Method
Return a state that is in the same group of states as the sprite's current state, but possibly pointing a different direction.

Namespace: (Default Namespace)
Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax
C#
public virtual int CalculateRotatedState(
	int FirstState,
	int StateCount,
	int NewState
)

Parameters

FirstState
Type: SystemInt32
Represents the beginning of this sprite's rotating states. This will usually be the sprite's first state, but can be something else if the sprite has other states before the first rotating state.
StateCount
Type: SystemInt32
Number of states in each rotation
NewState
Type: SystemInt32
Specifies the new state. The state group which this value specifies is ignored; only the offset into the group is used.

Return Value

Type: Int32
New state value that represents the state in the same group as the sprite's current state, but rotated according to NewState.
Remarks
This is commonly used in calculating a new state when left or right is pressed on a rotating sprite, to ensure that pressing left and right don't cause the sprite to change to a different group of states.
See Also