Home › Page › UghButtonDisablable

UghButtonDisablable

Revision for “UghButtonDisablable” created on 17 April, 2013 @ 19:17

Title
UghButtonDisablable
Content
Inherits fron <a title="UghButton" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughbutton">UghButton</a> UghButtonDiablable is an UghButton that can be disabled. When disabled, it shows an "unlocked" sprite and does not respond to user input at all. See <a title="UghButton" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughbutton">UghButton</a> for general UghButton use. [table caption="Variables" colwidth=20%|20%] name, type, description unlocked, <a title="UghSpriteDefinition" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspritedefinition">UghSpriteDefinition</a>, "The UghSpriteDefinition for when this button is unlocked, or enabled. It is, by default, locked and disabled." [/table] [table caption="Functions" colwidth=20%|20%] name, type, description SetLock,void, Sets the locked state to the given boolean. ToggleLock,void, Toggles the locked state of the button. [/table] [table caption="Inherited Variables" colwidth=20%|20%] name, type, description autoSizeCollider, boolean, Do we automatically resize the collider for this button? mouseOver,<a title="UghSpriteDefinition" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspritedefinition">UghSpriteDefinition</a>, The sprite definition for when the mouse hovers over the button pressed,<a title="UghSpriteDefinition" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspritedefinition">UghSpriteDefinition</a>, The sprite definition for when the mouse is clicking on or a finger is tapping on the button anchor,<a title="UghSprite.Anchor" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughsprite/anchor">UghSprite.Anchor</a>, The corner or custom point that the UghControl is anchored to customAnchorOffset, Vector3, The offset values for a custom anchor flippedHorizontal, boolean, Is the UghSprite flipped horizonally? flippedVertical, boolean, Is the UghSprite flipped vertically? HotFingerID, int, The ID of the finger interacting with this control isLegalControl, boolean, Is this a legal control? normal,<a title="UghSpriteDefinition" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspritedefinition">UghSpriteDefinition</a>, The default UghSpriteDefinition for this button Prototype,<a title="UghSpritePrototype" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspriteprototype-2">UghSpritePrototype</a>, The current UghSpritePrototype for this button Offset, Vector3, The offset of the UghSprite [/table] [table caption="Inherited Functions" colwidth=20%|20%] name, type, description OnDown, event, An event fired when the button is pressed down OnUghInputDown, void,Runs when the mouse clicks or a finger taps on this button OnUghInputUp, void,Runs when the mouse or finger drags off this button OnUghInputUpAsButton, void,Runs when the mouse stops clicking or a finger lifts up when over this button OnPressed, event, "An event fired when the button is released with the input over the button, at the same time as OnUghInputAsButton" GetLocalCenter, Vector3, Returns the local center of the UghControl GetLocalOrigin, Vector3, Returns the local origin of the UghControl GetParentPublisher,<a title="UghPublisher" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughpublisher">UghPublisher</a>, "Returns the UghPublisher which this UghControl belongs to, or null if none" UpdateMesh, void, Updates this control's mesh [/table] [table caption="Inherited Class Variables" colwidth=20%|20%] name, type, description Anchor, enum, Enum for different common anchor positions AnchorToTextAnchor, TextAnchor, Converts an Anchor enum into a TextAnchor enum TextAnchorToAnchor,<a title="UghSprite" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughsprite">UghSprite.Anchor</a>, Converts a TextAnchor enum into an Anchor enum theOnlyLegalControls,<a title="UghControl" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughcontrol">UghControl</a>[], Array of all currently legal controls [/table] [table caption="Inherited Class Functions" colwidth=20%|20%] name, type, description ForceUpdateAllUghSpriteMeshes, void, Forces every UghSprite's mesh to update GetOffsetForAnchor, Vector3, Returns the Vector3 offset for a given Anchor value [/table] <strong>_</strong> <strong>Using UghButtonDisablable in script</strong> UghButtonDisablable is a subclass of UghButton which adds the ability to use the button as an unlockable button. The <code>unlocked</code> variable is where the <a title="UghSpriteDefinition" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughspritedefinition">UghSpriteDefinition</a> of the locked version of your button is held. <strong>Added Functions</strong> [sourcecode language="csharp"] public void SetLock(bool b) [/sourcecode] This function is the public access for setting the locked state of the UghButtonDisableable. [sourcecode language="csharp"] public void ToggleLock() [/sourcecode] This function just flips the locked state to the opposite state. If you do not use an UghPublisher to manage your UghButtonDisablable, as with many other UghControls, you must register for the OnDown and/or the OnPressed events to know when the UghButtonDisablable has been interacted with.
Excerpt


OldNewDate CreatedAuthorActions
17 April, 2013 @ 19:17 admin
17 April, 2013 @ 18:24 admin
17 April, 2013 @ 18:24 [Autosave] admin
17 April, 2013 @ 18:23 admin
2 April, 2013 @ 15:43 admin
29 March, 2013 @ 17:44 admin
29 March, 2013 @ 17:42 admin
29 March, 2013 @ 17:41 admin
29 March, 2013 @ 17:39 admin
18 March, 2013 @ 14:58 admin
18 March, 2013 @ 14:56 admin
15 March, 2013 @ 16:42 admin
15 March, 2013 @ 16:41 admin
15 March, 2013 @ 16:41 admin
15 March, 2013 @ 16:34 admin
11 March, 2013 @ 19:23 admin
11 March, 2013 @ 17:32 admin
8 March, 2013 @ 21:17 admin
8 March, 2013 @ 21:17 admin
8 March, 2013 @ 21:13 admin
8 March, 2013 @ 21:12 admin
8 March, 2013 @ 20:36 admin
8 March, 2013 @ 19:22 admin
8 March, 2013 @ 19:22 admin
8 March, 2013 @ 19:20 admin
8 March, 2013 @ 19:20 admin
8 March, 2013 @ 19:19 admin
8 March, 2013 @ 17:17 admin
8 March, 2013 @ 16:35 admin
8 March, 2013 @ 16:23 admin
6 March, 2013 @ 21:51 admin
6 March, 2013 @ 21:51 admin