Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.CursorIcon Class Reference
Inheritance diagram for AC.CursorIcon:
AC.CursorIconBase AC.ITranslatable

Public Member Functions

 CursorIcon ()
 
 CursorIcon (int[] idArray)
 A Constructor that generates a unique id number. More...
 
string GetButtonName ()
 Gets the name of the expected input button that is used to quick-select the cursor (only applies if SettingsManager's interactionMethod is ChooseInteractionThenHotspot). More...
 
void Copy (CursorIcon _cursorIcon, bool includeTranslation)
 Copies the values from another CursorIcon. More...
 
string GetTranslatableString (int index)
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts. More...
 
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index More...
 
string GetOwner ()
 Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More...
 
bool OwnerIsPlayer ()
 Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More...
 
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. More...
 
bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 
- Public Member Functions inherited from AC.CursorIconBase
 CursorIconBase ()
 
void Copy (CursorIconBase _icon)
 Copies the values from another CursorIconBase. More...
 
void DrawAsInteraction (Rect _rect, bool isActive)
 Draws the graphic as part of a Menu, for when it's displayed within a MenuGraphic or MenuInteraction. More...
 
UnityEngine.Sprite GetSprite ()
 Gets a Sprite based on the texture supplied. The Sprite will be generated on the fly if it does not already exist. More...
 
UnityEngine.Sprite GetAnimatedSprite (int _frameIndex)
 Gets a Sprite based on the animated texture supplied. The Sprite will be generated on the fly if it does not already exist. More...
 
UnityEngine.Sprite GetAnimatedSprite (bool isActive)
 Gets a Sprite based on the animated texture supplied, when the texture is used within a MenuElement (MenuGraphic or MenuInteraction). The Sprite will be generated on the fly if it does not already exist. More...
 
void ClearSprites ()
 
Texture2D GetAnimatedTexture (bool canAnimate=true)
 Gets a slice of the texture that represents the current frame, if the texture consists of animated frames. More...
 
string GetName ()
 Gets a unique identifier, based on the texture and current animation frame. More...
 
void ClearCache ()
 Clears the animated Texture2D and Sprite caches.
 
Texture Draw (Vector2 centre, bool canAnimate=true)
 Draws the texture as a cursor icon More...
 
Rect GetAnimatedRect ()
 Gets a Rect that describes a slice of the animated texture that represents the current frame. More...
 
Rect GetAnimatedRect (int _frameIndex)
 Gets a Rect that describes a slice of the animated texture that represents a specific frame. More...
 
void Reset ()
 
void ShowGUI (bool includeSize, bool includeAlwaysAnimate=true, string _label="Texture:", CursorRendering cursorRendering=CursorRendering.Software, string apiPrefix="", string tooltip="")
 

Public Attributes

bool dontCycle = false
 
string label
 
int lineID = -1
 
int id
 
- Public Attributes inherited from AC.CursorIconBase
Texture texture
 
bool isAnimated = false
 
int numFrames = 1
 
int numRows = 1
 
int numCols = 1
 
float size = 0.015f
 
float animSpeed = 4f
 
bool endAnimOnLastFrame = false
 
bool skipFirstFrameWhenLooping = false
 
Vector2 clickOffset
 
float [] frameSpeeds
 
bool alwaysAnimate = false
 

Detailed Description

A data container for interaction cursor icons. These are stored in CursorManager.

Constructor & Destructor Documentation

◆ CursorIcon() [1/2]

AC.CursorIcon.CursorIcon ( )

The default Constructor.

◆ CursorIcon() [2/2]

AC.CursorIcon.CursorIcon ( int []  idArray)

A Constructor that generates a unique id number.

Parameters
idArrayAn array of previously-assigned id numbers

Member Function Documentation

◆ CanTranslate()

bool AC.CursorIcon.CanTranslate ( int  index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ Copy()

void AC.CursorIcon.Copy ( CursorIcon  _cursorIcon,
bool  includeTranslation 
)

Copies the values from another CursorIcon.

Parameters
_cursorIconThe CursorIcon to copy from
includeTranslationsIf True, then translation data will also be copied

◆ GetButtonName()

string AC.CursorIcon.GetButtonName ( )

Gets the name of the expected input button that is used to quick-select the cursor (only applies if SettingsManager's interactionMethod is ChooseInteractionThenHotspot).

Returns
The name of the expected input button, which should be defined in Unity's Input Manager

◆ GetNumTranslatables()

int AC.CursorIcon.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.CursorIcon.GetOwner ( )

Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.

Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetTranslatableString()

string AC.CursorIcon.GetTranslatableString ( int  index)

ITranslatable implementation

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.CursorIcon.GetTranslationID ( int  index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.CursorIcon.GetTranslationType ( int  index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ HasExistingTranslation()

bool AC.CursorIcon.HasExistingTranslation ( int  index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ OwnerIsPlayer()

bool AC.CursorIcon.OwnerIsPlayer ( )

Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.

Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ SetTranslationID()

void AC.CursorIcon.SetTranslationID ( int  index,
int  lineID 
)

Sets the translation ID of a given text index

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

Member Data Documentation

◆ dontCycle

bool AC.CursorIcon.dontCycle = false

If True, then the cursor will be left out of the cycle when right-clicking (only applies if SettingsManager's interactionMethod is ChooseInteractionThenHotspot)

◆ id

int AC.CursorIcon.id

A unique identifier

◆ label

string AC.CursorIcon.label

The display name of the icon

◆ lineID

int AC.CursorIcon.lineID = -1

The translation ID, as used by SpeechManager