Difference between revisions of "GUISelectableComponent"
From Virtual World Web Wiki
(Documentation for the GUISelectableComponent class) |
(Documentation for the GUISelectableComponent class) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | An abstract class for Unity components deriving from Selectable | ||
+ | |||
*'''Inherits class: [[GUILayoutComponent]]''' | *'''Inherits class: [[GUILayoutComponent]]''' | ||
* This is a JavaScript visible object | * This is a JavaScript visible object | ||
===Remarks <nowiki>[</nowiki>[{{fullurl:GUISelectableComponent Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ===Remarks <nowiki>[</nowiki>[{{fullurl:GUISelectableComponent Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ||
− | {{:GUISelectableComponent Remarks}} | + | {{#ifexist:GUISelectableComponent Remarks|{{:GUISelectableComponent Remarks}}|}} |
===Properties=== | ===Properties=== | ||
Line 86: | Line 88: | ||
===Events=== | ===Events=== | ||
− | :{{CSharp|OnBlur( | + | :{{CSharp|OnBlur()}} |
:: | :: | ||
::Event fired when focus is lost on this component | ::Event fired when focus is lost on this component | ||
− | :{{CSharp|OnFocus( | + | :{{CSharp|OnFocus()}} |
:: | :: | ||
::Event fired when focus comes to this component (via clicking or tab navigating) | ::Event fired when focus comes to this component (via clicking or tab navigating) | ||
− | :{{CSharp|OnMouseEntered( | + | :{{CSharp|OnMouseClick()}} |
+ | |||
+ | :{{CSharp|OnMouseDoubleClick()}} | ||
+ | |||
+ | :{{CSharp|OnMouseEntered()}} | ||
:: | :: | ||
::Event fired when mouse first crosses over | ::Event fired when mouse first crosses over | ||
− | :{{CSharp|OnMouseExited( | + | :{{CSharp|OnMouseExited()}} |
:: | :: | ||
::Event fired when mouse stops being over this component | ::Event fired when mouse stops being over this component | ||
+ | |||
+ | :{{CSharp|OnOpenContext()}} | ||
+ | :: | ||
+ | ::Event fired when we open a context menu from this component | ||
===Methods=== | ===Methods=== |
Latest revision as of 17:18, 19 November 2018
An abstract class for Unity components deriving from Selectable
- Inherits class: GUILayoutComponent
- This is a JavaScript visible object
Remarks [edit]
Properties
- JSVector4 Border {get; set;}
- Sets the border across all defined textures
- GUIAudio ClickSound {get;}
- Reference to audio clip we play when clicking on this component
- Color32 DisabledColor {get; set;}
- What color tint do we apply to the texture when disabled? (note: only in Transition ColorTint)
- GUISprite DisabledTexture {get;}
- What texture do we change to when this component is disabled? (note: only in Transition SpriteSwap)
- bool Enabled {get; set;}
- Can we click/interact with this component?
- float FadeDuration {get; set;}
- How long should a ColorTint transition take to apply?
- bool FillCenter {get; set;}
- If the sprite is set to Sliced, should the center be filled?
- Color32 HoverColor {get; set;}
- What color tint do we apply to the texture when hovering over it? (note: only in Transition ColorTint)
- GUIAudio HoverSound {get;}
- Reference to audio clip we play when hovering over this component
- GUISprite HoverTexture {get;}
- What texture do we change to when we hover over this component? (note: only in Transition SpriteSwap)
- Type ImageType {get; set;}
- What method should we use to display this image?
- GUISelectableComponent NextResponder {get; set;}
- If we tab away from this component, which component should be the next one to receive focus?
- Color32 NormalColor {get; set;}
- What color tint do we apply to the underlying image?
- GUISprite NormalTexture {get;}
- What texture is set for this component normally?
- bool PreserveAspect {get; set;}
- Should the aspect ratio of the image be preserved when stretched?
- Color32 PressedColor {get; set;}
- What color tint do we apply to the texture when pressing it? (note: only in Transition ColorTint)
- GUISprite PressedTexture {get;}
- What texture do we change to when we press this component? (note: only in Transition SpriteSwap)
- bool TabStop {get; set;}
- Should tabbing through controls stop on this component?
- GUILabel Text {get;}
- Reference to the label on this component
- Transition Transition {get; set;}
- Which transition system do we use to effect hovers/clicks?
Events
- OnBlur()
- Event fired when focus is lost on this component
- OnFocus()
- Event fired when focus comes to this component (via clicking or tab navigating)
- OnMouseClick()
- OnMouseDoubleClick()
- OnMouseEntered()
- Event fired when mouse first crosses over
- OnMouseExited()
- Event fired when mouse stops being over this component
- OnOpenContext()
- Event fired when we open a context menu from this component
Methods
- void SetFocus()
- Brings focus to this component