Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.SpriteDirectionData Class Reference

Classes

struct  SpriteDirection
 

Public Member Functions

 SpriteDirectionData (bool doDirections, bool doDiagonals)
 
 SpriteDirectionData (SpriteDirectionData other)
 
void ShowGUI ()
 
string GetExpectedList (AC_2DFrameFlipping frameFlipping, string animName, string indexString="")
 
string SaveData ()
 Converts the class's serializable data into a single string More...
 
void LoadData (string data)
 Restores the class's serializable data from a data string More...
 
void SetDirections (bool _down, bool _left, bool _right, bool _up, bool _downLeft, bool _upLeft, bool _upRight, bool _downRight)
 
bool HasDirections ()
 Checks if the character sprite makes use of directions More...
 
string GetDirectionalSuffix (float angle)
 Gets the directional suffix (i.e. "D" for Down, "UR" for Up-right) for the sprite direction that best matches the given angle More...
 

Properties

bool IsUpgraded [get]
 
SpriteDirection[] SpriteDirections [get]
 

Detailed Description

A data class for the various directions that a 2D sprite-based character can face.

Constructor & Destructor Documentation

◆ SpriteDirectionData() [1/2]

AC.SpriteDirectionData.SpriteDirectionData ( bool  doDirections,
bool  doDiagonals 
)

The default Constructor. This takes the now-deprecated values of the Char script's doDirections and doDiagonals variables to generate initial values.

◆ SpriteDirectionData() [2/2]

AC.SpriteDirectionData.SpriteDirectionData ( SpriteDirectionData  other)

A Constructor that copies its values from another class instance

Member Function Documentation

◆ GetDirectionalSuffix()

string AC.SpriteDirectionData.GetDirectionalSuffix ( float  angle)

Gets the directional suffix (i.e. "D" for Down, "UR" for Up-right) for the sprite direction that best matches the given angle

Parameters
angleThe angle, in degrees. This starts at 0 when downward, and rotates clockwise to 360 for a complete revolution.
Returns
The directional suffix (i.e. "D" for Down, "UR" for Up-right) for the sprite direction that best matches the given angle

◆ HasDirections()

bool AC.SpriteDirectionData.HasDirections ( )

Checks if the character sprite makes use of directions

Returns
True if the character sprite makes use of directions

◆ LoadData()

void AC.SpriteDirectionData.LoadData ( string  data)

Restores the class's serializable data from a data string

Parameters
dataThe data string to load from

◆ SaveData()

string AC.SpriteDirectionData.SaveData ( )

Converts the class's serializable data into a single string

Returns
The class's data<returns>

◆ SetDirections()

void AC.SpriteDirectionData.SetDirections ( bool  _down,
bool  _left,
bool  _right,
bool  _up,
bool  _downLeft,
bool  _upLeft,
bool  _upRight,
bool  _downRight 
)

Updates which directions are enabled

Property Documentation

◆ IsUpgraded

bool AC.SpriteDirectionData.IsUpgraded
get

Checks if this data has been upgraded from AC v1.66.0 or earlier. The upgrade process should be automatic.

◆ SpriteDirections

SpriteDirection [] AC.SpriteDirectionData.SpriteDirections
get

An array containing data about the various directions the sprite can face.