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

Public Member Functions

override void Declare ()
override MenuElement DuplicateSelf (bool fromEditor, bool ignoreUnityUI)
 Creates and returns a new MenuElement that has the same values as itself. More...
override void LoadUnityUI (AC.Menu _menu, Canvas canvas)
 Initialises the linked Unity UI GameObject. More...
override RectTransform GetRectTransform (int _slot)
 Gets the boundary of the element. More...
override void ShowGUI (Menu menu)
override void PreDisplay (int _slot, int languageNumber, bool isActive)
 Performs all calculations necessary to display the element. More...
override void Display (GUIStyle _style, int _slot, float zoom, bool isActive)
 Draws the element using OnGUI More...
- Public Member Functions inherited from AC.MenuElement
virtual void Copy (MenuElement _element)
 Copies the values of another MenuElement onto itself. More...
virtual void Initialise (AC.Menu _menu)
 Performs any initialisation that can only be done once the element has been instantiated at runtime. More...
virtual void ProcessClick (AC.Menu _menu, int _slot, MouseState _mouseState)
 Performs what should happen when the element is clicked on. More...
virtual void ProcessContinuousClick (AC.Menu _menu, MouseState _mouseState)
 Performs what should happen when the element is clicked on continuously. More...
virtual GameObject GetObjectToSelect (int slotIndex=0)
 Gets the linked Unity UI GameObject associated with this element. More...
virtual void SetSpeech (Speech _speech)
 Assigns the element to a specific Speech line. More...
virtual void ClearSpeech ()
void UpdateID (int[] idArray)
 Updates the ID number to something unique. More...
virtual string GetLabel (int slot, int languageNumber)
 Gets the display text of the element, or a slot within it. More...
virtual bool IsSelectedByEventSystem (int slotIndex)
 Checks if the element is selected by Unity UI's EventSystem. More...
void ShowGUIStart (Menu menu)
virtual bool CheckConvertGlobalVariableToLocal (int oldGlobalID, int newLocalID)
 Checks if the Elements makesreferences from a given global variable to a given local variable More...
virtual int GetVariableReferences (int varID)
 Gets the number of references the MenuElement makes to a global variable More...
virtual void HideAllUISlots ()
virtual string GetHotspotLabelOverride (int _slot, int _language)
 Gets a string that overrides the default 'hotspot label'. More...
virtual void DrawOutline (bool isSelected, AC.Menu _menu)
 Draws an outline around the element. More...
Vector2 [] GetSlotCentres (AC.Menu _menu)
 Gets the element's slot centres, as an array of Vector2s. This is used when keyboard-navigating menus More...
virtual void Shift (AC_ShiftInventory shiftType, int amount)
 Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once. More...
virtual bool CanBeShifted (AC_ShiftInventory shiftType)
 Checks if the element's slots can be shifted in a particular direction. More...
Vector2 GetSize ()
 Gets the size of the whole element. More...
Vector2 GetSizeFromCorner ()
 Gets the Vector2 from the top-left corner of the parent Menu to the bottom-right corner of the element. More...
void SetSize (Vector2 _size)
 Sets the size of an individual slot. More...
int GetNumSlots ()
 Gets the number of display slots the element has. This is not the maximum number of slots that can be shown by shifting - it is the number of slots that are shown at any one time. More...
Rect GetSlotRectRelative (int _slot)
 Gets the boundary of a slot, as a proportion of the screen size. More...
virtual void RecalculateSize (MenuSource source)
 Recalculates the element's size. This should be called whenever a Menu's shape is changed. More...
int GetFontSize ()
 Gets the size of the font. More...
void SetPosition (Vector2 _position)
 Sets the element's position. More...
void SetRelativePosition (Vector2 _size)
void ResetDragOffset ()
void SetDragOffset (Vector2 pos, Rect dragRect)
 Offsets an OnGUI MenuElement's position when dragged by a MenuDrag element. More...
Vector2 GetDragStart ()
 Gets the drag offset. More...
void AutoSetVisibility ()
virtual void SetUIInteractableState (bool state)
 Sets the interactive state of any linked Unity UI gameobjects. More...
int GetOffset ()
 Gets the amount by which the slots have been offset, if the number that can be shown exceeds the number that can be display at once. More...
void SetOffset (int value)
 Sets the amount by which the slots have been offset, if the number that can be shown exceeds the number that can be display at once. More...
virtual void OnMenuTurnOn (Menu menu)
 Called whenever the Menu this is attached to is turned on. More...

Public Attributes

Slider uiSlider
bool doInvert
Texture2D timerTexture
AC_TimerType timerType = AC_TimerType.Conversation
UISelectableHideStyle uiSelectableHideStyle = UISelectableHideStyle.DisableObject
- Public Attributes inherited from AC.MenuElement
int ID
string title = "Element"
Vector2 slotSize
AC_SizeType sizeType
AC_PositionType2 positionType
float slotSpacing = 0f
int lineID = -1
string alternativeInputButton = ""
Font font
float fontScaleFactor = 60f
Color fontColor = Color.white
Color fontHighlightColor = Color.white
bool isClickable
ElementOrientation orientation = ElementOrientation.Vertical
int gridWidth = 3
Texture2D backgroundTexture
bool singleSlotBackgrounds = false
Texture2D highlightTexture
AudioClip hoverSound
AudioClip clickSound
bool changeCursor = false
int cursorID = 0
int linkedUiID

Additional Inherited Members

- Protected Member Functions inherited from AC.MenuElement
void CreateUIEvent (UnityEngine.UI.Button uiButton, AC.Menu _menu, UIPointerState uiPointerState=UIPointerState.PointerClick, int _slotIndex=0, bool liveState=true)
void ProcessClickUI (AC.Menu _menu, int _slot, MouseState _mouseState)
string TranslateLabel (string label, int languageNumber)
virtual void ShowTextGUI (string apiPrefix)
virtual void ShowTextureGUI (string apiPrefix)
void EndGUI (string apiPrefix)
void ShowClipHelp ()
LinkedUiGUI< T > (T field, string label, MenuSource source, string tooltip="")
UISlot [] ResizeUISlots (UISlot[] uiSlots, int maxSlots)
void ChangeCursorGUI (Menu menu)
void LimitUISlotVisibility (UISlot[] uiSlots, int _numSlots, UIHideStyle uiHideStyle)
Rect ZoomRect (Rect rect, float zoom)
void LimitOffset (int maxValue)
void Shift (AC_ShiftInventory shiftType, int maxSlots, int arraySize, int amount)
void SetAbsoluteSize (Vector2 _size)
void AutoSize (GUIContent content)
virtual void AutoSize ()
LinkUIElement< T > (Canvas canvas)
void UpdateUISelectable< T > (T field, UISelectableHideStyle uiSelectableHideStyle)
void UpdateUIElement< T > (T field)
void ClearSpriteCache (UISlot[] uiSlots)
void SetUISlotsInteractableState (UISlot[] uiSlots, bool state)
- Protected Attributes inherited from AC.MenuElement
bool isVisible = true
int offset = 0
Menu parentMenu
Rect relativeRect
Vector2 relativePosition
int numSlots
- Properties inherited from AC.MenuElement
bool IsVisible [get, set]
string IDString [get]
Menu ParentMenu [get]

Detailed Description

A MenuElement that provides a "countdown" timer that can either show the time remaining to choose a Conversation's dialogue option or complete a QTE, or the progress made in the current QTE.

Member Function Documentation

◆ Declare()

override void AC.MenuTimer.Declare ( )

Initialises the MenuElement when it is created within MenuManager.

Reimplemented from AC.MenuElement.

◆ Display()

override void AC.MenuTimer.Display ( GUIStyle  _style,
int  _slot,
float  zoom,
bool  isActive 

Draws the element using OnGUI

_styleThe GUIStyle to draw with
_slotIgnored by this subclass
zoomThe zoom factor
isActiveIf True, then the element will be drawn as though highlighted

Reimplemented from AC.MenuElement.

◆ DuplicateSelf()

override MenuElement AC.MenuTimer.DuplicateSelf ( bool  fromEditor,
bool  ignoreUnityUI 

Creates and returns a new MenuElement that has the same values as itself.

fromEditorIf True, the duplication was done within the Menu Manager and not as part of the gameplay initialisation.
ignoreUnityUIIf True, variables associated with Unity UI will not be transferred
A new MenuElement with the same values as itself

Reimplemented from AC.MenuElement.

◆ GetRectTransform()

override RectTransform AC.MenuTimer.GetRectTransform ( int  _slot)

Gets the boundary of the element.

_slotIgnored by this subclass
The boundary Rect of the element

Reimplemented from AC.MenuElement.

◆ LoadUnityUI()

override void AC.MenuTimer.LoadUnityUI ( AC.Menu  _menu,
Canvas  canvas 

Initialises the linked Unity UI GameObject.

_menuThe element's parent Menu

Reimplemented from AC.MenuElement.

◆ PreDisplay()

override void AC.MenuTimer.PreDisplay ( int  _slot,
int  languageNumber,
bool  isActive 

Performs all calculations necessary to display the element.

_slotThe index number of the slot to display
languageNumberThe index number of the language to display text in
isActiveIf True, then the element will be drawn as though highlighted

Reimplemented from AC.MenuElement.

Member Data Documentation

◆ doInvert

bool AC.MenuTimer.doInvert

If True, then the value will be inverted, and the timer will move in the opposite direction

◆ timerTexture

Texture2D AC.MenuTimer.timerTexture

The texture of the slider bar (OnGUI Menus only)

◆ timerType

AC_TimerType AC.MenuTimer.timerType = AC_TimerType.Conversation

What the value of the timer represents (Conversation, QuickTimeEventProgress, QuickTimeEventRemaining)

◆ uiSelectableHideStyle

UISelectableHideStyle AC.MenuTimer.uiSelectableHideStyle = UISelectableHideStyle.DisableObject

The method by which this element is hidden from view when made invisible (DisableObject, DisableInteractability)

◆ uiSlider

Slider AC.MenuTimer.uiSlider

The Unity UI Slider this is linked to (Unity UI Menus only)