Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.CursorIcon Class Reference
Inheritance diagram for AC.CursorIcon:
AC.CursorIconBase AC.ITranslatable

Public Member Functions

 CursorIcon ()
 CursorIcon (CursorIcon cursorIcon)
 CursorIcon (int[] idArray)
 A Constructor that generates a unique id number.
override void ClearCache ()
void UpdateLabel (int languageNumber)
string GetLabel (int languageNumber)
 Gets the icon's display name.
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).
void Copy (CursorIcon _cursorIcon, bool includeTranslation)
 Copies the values from another CursorIcon.
string GetTranslatableString (int index)
 Gets the text to be translated, given its index.
int GetTranslationID (int index)
 Gets the translation ID of a given text index.
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index.
void UpdateTranslatableString (int index, string updatedText)
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts.
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID.
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index.
string GetOwner (int index)
 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.
bool OwnerIsPlayer (int index)
 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.
bool CanTranslate (int index)
 Checks if a given text index can and should be translated.
Public Member Functions inherited from AC.CursorIconBase
 CursorIconBase ()
void Copy (CursorIconBase _icon)
 Copies the values from another CursorIconBase.
void DrawAsInteraction (Rect _rect, bool isActive)
 Draws the graphic as part of a Menu, for when it's displayed within a MenuGraphic or MenuInteraction.
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.
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.
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.
void ReplaceTexture (Texture newTexture)
 Replaces the icon's texture, and also clears internal caches.
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.
string GetName ()
 Gets a unique identifier, based on the texture and current animation frame.
Texture Draw (Vector2 centre, bool canAnimate=true)
 Draws the texture as a cursor icon.
Rect GetAnimatedRect ()
 Gets a Rect that describes a slice of the animated texture that represents the current frame.
Rect GetAnimatedRect (int _frameIndex)
 Gets a Rect that describes a slice of the animated texture that represents a specific frame.
void Reset (bool resetFrameIndex=true)
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

Additional Inherited Members

Static Public Member Functions inherited from AC.CursorIconBase
static bool IsValid (CursorIconBase cursorIcon)

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.

◆ ClearCache()

override void AC.CursorIcon.ClearCache ( )
virtual

Clears the animated Texture2D and Sprite caches.

Reimplemented from AC.CursorIconBase.

◆ 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

◆ GetLabel()

string AC.CursorIcon.GetLabel ( int languageNumber)

Gets the icon's display name.

Parameters
languageNumberThe index of the current language, as set in SpeechManager
Returns
The icon's display name

◆ 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 ( int index)

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.

Parameters
indexThe index of the translatable text
Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetTranslatableString()

string AC.CursorIcon.GetTranslatableString ( int index)

Gets the text to be translated, given its index.

Parameters
indexThe index of the translatable text
Returns
The text to be translated

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 ( int index)

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.

Parameters
indexThe index of the translatable text
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.

◆ UpdateTranslatableString()

void AC.CursorIcon.UpdateTranslatableString ( int index,
string updatedText )

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