Click or drag to resize
SpriteBaseGetPolarStateByVector Method
Calculate the state that a rotating sprite should use in order to point in the direction it is currently traveling

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

Parameters

FirstState
Type: SystemInt32
Provide the first state of this sprite's group of states (representing the sprite pointing rightward).
StateCount
Type: SystemInt32
Provide the number of states this sprite takes to represent one full rotation.

Return Value

Type: Int32
FirstState must represent the sprite in a rightward-aiming state, and each subsequent state must represent an equal counter-clockwise rotation until StateCount states result in the sprite pointing almost rightward again. The returned state number will be in that range. The result of this can be stored directly into state if you want the sprite to switch to that state.
See Also