Adventure Creator  1.74.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2019
AC.PlayerCursor Class Reference
Inheritance diagram for AC.PlayerCursor:

Public Member Functions

void UpdateCursor ()
 
void SetSelectedCursorID (int _cursorID)
 Sets the active cursor ID, provided that the interaction method is CustomScript. More...
 
void DrawCursor ()
 
Texture GetCurrentCursorTexture ()
 Gets the current cursor texture. More...
 
int GetSelectedCursor ()
 Gets the index number of the currently-selected cursor within CursorManager's cursorIcons List. More...
 
virtual bool IsInWalkMode ()
 
int GetSelectedCursorID ()
 Gets the ID number of the currently-selected cursor, within CursorManager's cursorIcons List. More...
 
void ResetSelectedCursor ()
 Resets the currently-selected cursor More...
 
void SetCursorFromID (int ID)
 Sets the cursor to an icon defined in CursorManager. More...
 
void SetCursor (CursorIcon _icon)
 Sets the cursor to an icon defined in CursorManager. More...
 
void SetCursorVisibility (bool state)
 Sets the visiblity of the cursor. More...
 

Protected Member Functions

void Start ()
 
void DrawMainCursor ()
 
void ShowContextIcons ()
 
void ShowContextIcons (InvItem invItem)
 
void ShowCycleCursor (int useCursorID)
 
void DrawInventoryCursor ()
 
void DrawActiveInventoryCursor ()
 
void DrawIcon (Rect _rect, Texture _tex)
 
void SetHardwareCursor (Texture2D texture2D, Vector2 clickOffset)
 
void DrawIcon (Vector2 offset, CursorIconBase icon, bool isLook, bool canAnimate=true)
 
void DrawIcon (CursorIconBase icon, bool isLook, bool canAnimate=true)
 
void RecordCursorTexture (Texture newCursorTexture)
 
void CycleCursors ()
 
void CycleCursorsBack ()
 
bool CanDisplayIconsSideBySide ()
 
bool CanCycleContextSensitiveMode ()
 
void OnApplicationQuit ()
 

Protected Attributes

Menu limitCursorToMenu
 
int selectedCursor = -10
 
bool showCursor = false
 
bool canShowHardwareCursor = false
 
float pulse = 0f
 
int pulseDirection = 0
 
CursorIconBase activeIcon = null
 
CursorIconBase activeLookIcon = null
 
string lastCursorName
 
Texture2D currentCursorTexture2D
 
Texture currentCursorTexture
 
bool contextCycleExamine = false
 
int manualCursorID = -1
 
bool isDrawingHiddenCursor = false
 
bool forceOffCursor
 
bool lastIconLook
 

Properties

bool ForceOffCursor [set]
 
bool ContextCycleExamine [get]
 
int SelectedCursor [set]
 
Menu LimitCursorToMenu [get, set]
 

Detailed Description

This script displays the cursor on screen. The available cursors are defined in CursorManager. It should be placed on the GameEngine prefab.

Member Function Documentation

◆ DrawCursor()

void AC.PlayerCursor.DrawCursor ( )

Draws the cursor. This is called from StateHandler's OnGUI() function.

◆ GetCurrentCursorTexture()

Texture AC.PlayerCursor.GetCurrentCursorTexture ( )

Gets the current cursor texture.

Returns
The current cursor texture. If the cursor is hidden or showing no texture, the last-assigned texture will be returned instead.

◆ GetSelectedCursor()

int AC.PlayerCursor.GetSelectedCursor ( )

Gets the index number of the currently-selected cursor within CursorManager's cursorIcons List.

Returns
If = -2, the inventory cursor is showing. If = -1, the main pointer is showing. If > 0, the index number of the currently-selected cursor within CursorManager's cursorIcons List

◆ GetSelectedCursorID()

int AC.PlayerCursor.GetSelectedCursorID ( )

Gets the ID number of the currently-selected cursor, within CursorManager's cursorIcons List.

Returns
The ID number of the currently-selected cursor, within CursorManager's cursorIcons List

◆ IsInWalkMode()

virtual bool AC.PlayerCursor.IsInWalkMode ( )
virtual

Returns True if the cursor is currently set to walk mode

◆ ResetSelectedCursor()

void AC.PlayerCursor.ResetSelectedCursor ( )

Resets the currently-selected cursor

◆ SetCursor()

void AC.PlayerCursor.SetCursor ( CursorIcon  _icon)

Sets the cursor to an icon defined in CursorManager.

Parameters
_iconThe cursor, within CursorManager's cursorIcons List, to select

◆ SetCursorFromID()

void AC.PlayerCursor.SetCursorFromID ( int  ID)

Sets the cursor to an icon defined in CursorManager.

Parameters
IDThe ID number of the cursor, within CursorManager's cursorIcons List, to select

◆ SetCursorVisibility()

void AC.PlayerCursor.SetCursorVisibility ( bool  state)

Sets the visiblity of the cursor.

Parameters
stateIf True, the cursor will be shown. If False, the cursor will be hidden."

◆ SetSelectedCursorID()

void AC.PlayerCursor.SetSelectedCursorID ( int  _cursorID)

Sets the active cursor ID, provided that the interaction method is CustomScript.

Parameters
_cursorIDThe ID number of the cursor defined in the Cursor Manager. If set to -1, the current cursor will be deselected main cursor will be displayed.

◆ UpdateCursor()

void AC.PlayerCursor.UpdateCursor ( )

Updates the cursor. This is called every frame by StateHandler.

Property Documentation

◆ ForceOffCursor

bool AC.PlayerCursor.ForceOffCursor
set

If True, the cursor will always be hidden.

◆ LimitCursorToMenu

Menu AC.PlayerCursor.LimitCursorToMenu
getset

If set, the cursor's range of movement will be limited to this Menu's boundary