UI Accessibility Plugin  Version 1.1.1
Make your UI accessible for visually impaired users
UAP_BaseElement Class Reference

This is the base for all accessibility UI components. Use this to set values directly. More...

Inheritance diagram for UAP_BaseElement:
AccessibleButton AccessibleDropdown AccessibleLabel AccessibleSlider AccessibleTextEdit AccessibleToggle UAP_BaseElement_3D AccessiblePluginToggle AccessibleButton_3D AccessibleLabel_3D

Classes

class  UAPBoolCallback
 
class  UAPHighlightCallback
 

Public Types

enum  EHighlightSource { Internal = 0, UserInput, TouchExplore }
 

Public Member Functions

void Initialize ()
 
void SetAsStartItem ()
 
virtual bool Is3DElement ()
 Whether this is a 3D object (actual 3D, not on a UI canvas or NGUI root) More...
 
virtual bool AutoFillTextLabel ()
 
virtual bool IsInteractable ()
 
void Interact ()
 
void InteractEnd ()
 
void InteractAbort ()
 
string GetTextToRead ()
 
void SetCustomText (string itemText)
 Convenience function to set the text on this element manually and disable the automatic label reading at the same time Text is expected to be localized (if applicable). This function will disable the setting treating the text as a localization key More...
 
virtual string GetCurrentValueAsText ()
 
virtual AudioClip GetCurrentValueAsAudio ()
 
virtual bool IsElementActive ()
 
bool SelectItem (bool forceRepeatItem=false)
 Call this function to force select this UI element. By default, if the element is already selected before this function was called, the element is not read out aloud again. If you want to force the repetition, pass true as a parameter. More...
 
virtual bool Increment ()
 
virtual bool Decrement ()
 
virtual void HoverHighlight (bool enable, EHighlightSource selectionSource)
 
GameObject GetTargetGameObject ()
 
bool IsNameLocalizationKey ()
 
string GetCustomHint ()
 
void SetCustomHintText (string hintText, bool isLocalizationKey=false)
 Sets a custom hint text for this UI element, overriding the default text. The purpose of this text is to tell the player how to use the UI element, and give additional information as to what the element does. Most of the time, changing this is NOT needed. A default hint for a button (on mobile) would for example be 'Double tap to activate'. It might makes sense to change this to 'Double tap to sell this inventory item' Only interactive UI elements support hint texts. More...
 
void ResetHintText ()
 

Static Public Member Functions

static string FilterText (string text)
 

Public Attributes

UnityEvent m_OnInteractionStart = new UnityEvent()
 
UnityEvent m_OnInteractionEnd = new UnityEvent()
 
UnityEvent m_OnInteractionAbort = new UnityEvent()
 
bool m_ForceStartHere = false
 
int m_ManualPositionOrder = -1
 
GameObject m_ManualPositionParent = null
 
bool m_UseTargetForOutline = false
 
int m_PositionOrder = 0
 
int m_SecondaryOrder = 0
 
Vector2 m_Pos = new Vector2(0, 0)
 
AudioClip m_TextAsAudio = null
 
string m_Prefix = ""
 
bool m_PrefixIsLocalizationKey = false
 
bool m_PrefixIsPostFix = false
 
bool m_FilterText = true
 Only relevant if this is not a combination string.
 
string m_Text = ""
 This will remove formatting from text, for example or [#FF3C3C] and [-]. More...
 
GameObject m_NameLabel = null
 Label that contains the name or description of the edit box. Use this to directly read localized content.

More...
 
List< GameObject > m_AdditionalNameLabels = null
 
GameObject[] m_TestList = null
 
bool m_IsLocalizationKey = false
 Uses the text inside m_NameLabel and requests translation. More...
 
bool m_TryToReadLabel = true
 Only works if there is a text label component either on this GameObject or set as a reference.
 
GameObject m_ReferenceElement = null
 Only set this if the accessibility component doesn't sit on the same GameObject.
 
bool m_AllowVoiceOver = true
 In very specific circumstances it can make sense to deliberately prevent using VoiceOver from speaking this element.
 
bool m_ReadType = true
 In very specific circumstances you might want to suppress the reading of the type.
 
bool m_WasJustAdded = true
 
AccessibleUIGroupRoot.EUIElement m_Type = AccessibleUIGroupRoot.EUIElement.EUndefined
 
bool m_CustomHint = false
 
AudioClip m_HintAsAudio = null
 
string m_Hint = ""
 
bool m_HintIsLocalizationKey = false
 
bool m_IsInsideScrollView = false
 
bool m_IsInitialized = false
 
UAPHighlightCallback m_CallbackOnHighlight = new UAPHighlightCallback()
 

Protected Member Functions

virtual void AutoInitialize ()
 Do not call this function directly, use Initialize() instead. More...
 
virtual void OnInteract ()
 
virtual void OnInteractEnd ()
 
virtual void OnInteractAbort ()
 End the interaction but - if it makes sense - restore previous value.
 
string CombinePrefix (string text)
 
virtual string GetMainText ()
 
virtual void OnHoverHighlight (bool enable)
 
string GetTextFromTextMeshPro (Component textMeshProLabel)
 
virtual string GetLabelText (GameObject go)
 
Component GetTextMeshProLabelInChildren ()
 

Detailed Description

This is the base for all accessibility UI components. Use this to set values directly.

Member Function Documentation

virtual void UAP_BaseElement.AutoInitialize ( )
protectedvirtual

Do not call this function directly, use Initialize() instead.

Reimplemented in AccessibleToggle, AccessibleButton, and AccessibleLabel.

virtual bool UAP_BaseElement.Is3DElement ( )
virtual

Whether this is a 3D object (actual 3D, not on a UI canvas or NGUI root)

Returns

Reimplemented in UAP_BaseElement_3D.

bool UAP_BaseElement.SelectItem ( bool  forceRepeatItem = false)

Call this function to force select this UI element. By default, if the element is already selected before this function was called, the element is not read out aloud again. If you want to force the repetition, pass true as a parameter.

Parameters
forceRepeatItemIf true, the item will be read aloud again even if it was already selected. Has no effect if the item wasn't selected prior to this function call.
void UAP_BaseElement.SetCustomHintText ( string  hintText,
bool  isLocalizationKey = false 
)

Sets a custom hint text for this UI element, overriding the default text. The purpose of this text is to tell the player how to use the UI element, and give additional information as to what the element does. Most of the time, changing this is NOT needed. A default hint for a button (on mobile) would for example be 'Double tap to activate'. It might makes sense to change this to 'Double tap to sell this inventory item' Only interactive UI elements support hint texts.

Returns
void UAP_BaseElement.SetCustomText ( string  itemText)

Convenience function to set the text on this element manually and disable the automatic label reading at the same time Text is expected to be localized (if applicable). This function will disable the setting treating the text as a localization key

Parameters
itemText

Member Data Documentation

bool UAP_BaseElement.m_IsLocalizationKey = false

Uses the text inside m_NameLabel and requests translation.

GameObject UAP_BaseElement.m_NameLabel = null

Label that contains the name or description of the edit box. Use this to directly read localized content.

string UAP_BaseElement.m_Text = ""

This will remove formatting from text, for example or [#FF3C3C] and [-].

This variable contains the text that will be read aloud if this UI element receives focus. This variable will only be used if the plugin is not reading text directly from a text label.


The documentation for this class was generated from the following file: