Difference between revisions of "GUISelectableComponent"
From Virtual World Web Wiki
(Documentation for the GUISelectableComponent class) |
(Documentation for the GUISelectableComponent class) |
||
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 | ||
Line 6: | Line 8: | ||
===Properties=== | ===Properties=== | ||
:{{CSharp|JSVector4 Border {get; set;} }} | :{{CSharp|JSVector4 Border {get; set;} }} | ||
+ | :: | ||
+ | ::Sets the border across all defined textures | ||
:{{CSharp|GUIAudio ClickSound {get;} }} | :{{CSharp|GUIAudio ClickSound {get;} }} | ||
+ | :: | ||
+ | ::Reference to audio clip we play when clicking on this component | ||
:{{CSharp|Color32 DisabledColor {get; set;} }} | :{{CSharp|Color32 DisabledColor {get; set;} }} | ||
+ | :: | ||
+ | ::What color tint do we apply to the texture when disabled? (note: only in Transition ColorTint) | ||
:{{CSharp|GUISprite DisabledTexture {get;} }} | :{{CSharp|GUISprite DisabledTexture {get;} }} | ||
+ | :: | ||
+ | ::What texture do we change to when this component is disabled? (note: only in Transition SpriteSwap) | ||
:{{CSharp|bool Enabled {get; set;} }} | :{{CSharp|bool Enabled {get; set;} }} | ||
+ | :: | ||
+ | ::Can we click/interact with this component? | ||
:{{CSharp|float FadeDuration {get; set;} }} | :{{CSharp|float FadeDuration {get; set;} }} | ||
+ | :: | ||
+ | ::How long should a ColorTint transition take to apply? | ||
:{{CSharp|bool FillCenter {get; set;} }} | :{{CSharp|bool FillCenter {get; set;} }} | ||
+ | :: | ||
+ | ::If the sprite is set to Sliced, should the center be filled? | ||
:{{CSharp|Color32 HoverColor {get; set;} }} | :{{CSharp|Color32 HoverColor {get; set;} }} | ||
+ | :: | ||
+ | ::What color tint do we apply to the texture when hovering over it? (note: only in Transition ColorTint) | ||
:{{CSharp|GUIAudio HoverSound {get;} }} | :{{CSharp|GUIAudio HoverSound {get;} }} | ||
+ | :: | ||
+ | ::Reference to audio clip we play when hovering over this component | ||
:{{CSharp|GUISprite HoverTexture {get;} }} | :{{CSharp|GUISprite HoverTexture {get;} }} | ||
+ | :: | ||
+ | ::What texture do we change to when we hover over this component? (note: only in Transition SpriteSwap) | ||
:{{CSharp|Type ImageType {get; set;} }} | :{{CSharp|Type ImageType {get; set;} }} | ||
+ | :: | ||
+ | ::What method should we use to display this image? | ||
:{{CSharp|GUISelectableComponent NextResponder {get; set;} }} | :{{CSharp|GUISelectableComponent NextResponder {get; set;} }} | ||
+ | :: | ||
+ | ::If we tab away from this component, which component should be the next one to receive focus? | ||
:{{CSharp|Color32 NormalColor {get; set;} }} | :{{CSharp|Color32 NormalColor {get; set;} }} | ||
+ | :: | ||
+ | ::What color tint do we apply to the underlying image? | ||
:{{CSharp|GUISprite NormalTexture {get;} }} | :{{CSharp|GUISprite NormalTexture {get;} }} | ||
+ | :: | ||
+ | ::What texture is set for this component normally? | ||
:{{CSharp|bool PreserveAspect {get; set;} }} | :{{CSharp|bool PreserveAspect {get; set;} }} | ||
+ | :: | ||
+ | ::Should the aspect ratio of the image be preserved when stretched? | ||
:{{CSharp|Color32 PressedColor {get; set;} }} | :{{CSharp|Color32 PressedColor {get; set;} }} | ||
+ | :: | ||
+ | ::What color tint do we apply to the texture when pressing it? (note: only in Transition ColorTint) | ||
:{{CSharp|GUISprite PressedTexture {get;} }} | :{{CSharp|GUISprite PressedTexture {get;} }} | ||
+ | :: | ||
+ | ::What texture do we change to when we press this component? (note: only in Transition SpriteSwap) | ||
:{{CSharp|bool TabStop {get; set;} }} | :{{CSharp|bool TabStop {get; set;} }} | ||
+ | :: | ||
+ | ::Should tabbing through controls stop on this component? | ||
:{{CSharp|GUILabel Text {get;} }} | :{{CSharp|GUILabel Text {get;} }} | ||
+ | :: | ||
+ | ::Reference to the label on this component | ||
:{{CSharp|Transition Transition {get; set;} }} | :{{CSharp|Transition Transition {get; set;} }} | ||
+ | :: | ||
+ | ::Which transition system do we use to effect hovers/clicks? | ||
===Events=== | ===Events=== | ||
:{{CSharp|OnBlur()}} | :{{CSharp|OnBlur()}} | ||
+ | :: | ||
+ | ::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) | ||
:{{CSharp|OnMouseEntered()}} | :{{CSharp|OnMouseEntered()}} | ||
+ | :: | ||
+ | ::Event fired when mouse first crosses over | ||
:{{CSharp|OnMouseExited()}} | :{{CSharp|OnMouseExited()}} | ||
+ | :: | ||
+ | ::Event fired when mouse stops being over this component | ||
:{{CSharp|OnOpenContext()}} | :{{CSharp|OnOpenContext()}} | ||
+ | :: | ||
+ | ::Event fired when we open a context menu from this component | ||
===Methods=== | ===Methods=== | ||
:{{CSharp|void SetFocus()}} | :{{CSharp|void SetFocus()}} | ||
+ | :: | ||
+ | ::Brings focus to this component | ||
__NOTOC____NOEDITSECTION__ | __NOTOC____NOEDITSECTION__ |
Revision as of 12:55, 26 May 2017
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)
- 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