Home › Page › UghSprite

UghSprite

Revision for “UghSprite” created on 17 April, 2013 @ 18:18

Title
UghSprite
Content
Inherits from MonoBehaviour Any visual Ugh element inherits ultimately from UghSprite, including UghButton, UghSlider, and UghToggle, to list a few. [table caption="Variables" colwidth=20%|20%] name, type, description anchor,<a title="UghSprite.Anchor" href="http://ugh.graveck.com/wiki/ugh-scripting-reference/ughsprite/anchor">UghSprite</a>.Anchor, The corner or custom point that the UghSprite 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? 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="Functions" colwidth=20%|20%] name, type, description 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="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</a>.Anchor, Converts a TextAnchor enum into an Anchor enum [/table] [table caption="Class Functions" colwidth=20%|20%] name, type, description ForceUpdateAllUghSpriteMeshes, void, Forces an UpdateMesh on all UghSprites in the Scene GetOffsetForAnchor, Vector3, Returns the Vector3 offset for a given Anchor value [/table] <strong>Using UghSprite in script</strong> UghSprite is the core component of most Ugh assets and is therefore the base of most other Ugh scripting. It is handled primarily through the Unity Inspector and the hierarchy view. A tutorial for using and implementing an UghSprite in the inspector can be found <span style="text-decoration: underline;">here</span>. UghSprites can be interacted with in script as well. a good example would be modifying the scale of the UghSprite or it's position to facilitate interesting effects like a throbbing sprite animation of the UghSprite asset. <strong>UghSprite Class Functions</strong> These functions are for providing useful information for interacting with UghSprites. They return the local Center, Origin, or the UghPublisher the UghSprite belongs to. The UpdateMesh function provides a way to update any changes made to an UghSprite in script immediately. [sourcecode language="csharp"]&lt;br /&gt;public Vector3 GetLocalCenter();&lt;br /&gt;public Vector3 GetLocalOrigin();&lt;br /&gt;public UghPublisher GetParentPublisher();&lt;br /&gt;public void UpdateMesh();&lt;br /&gt;[/sourcecode] UghSprite has two <strong>static class functions</strong> for updating and getting information from UghSprites [sourcecode language="csharp"]&lt;br /&gt;public static void ForceUpdateAllUghSpriteMeshes()&lt;br /&gt;[/sourcecode] This function is provided in the Ugh menu and is used for updating all the UghSprite assets in the current scene. and, [sourcecode language="csharp"]&lt;br /&gt;public static Vector3 GetOffsetForAnchor(Anchor anchor, Vector3 customAnchorOffset)&lt;br /&gt;[/sourcecode] This function provides the user with the current offset Vector of a passed in Anchor type.
Excerpt


OldNewDate CreatedAuthorActions
17 April, 2013 @ 18:18 admin
17 April, 2013 @ 18:17 admin
17 April, 2013 @ 18:17 [Autosave] admin
17 April, 2013 @ 18:16 admin
3 April, 2013 @ 19:39 admin
2 April, 2013 @ 14:20 admin
29 March, 2013 @ 17:01 admin
29 March, 2013 @ 17:01 admin
29 March, 2013 @ 17:00 admin
29 March, 2013 @ 15:12 admin
29 March, 2013 @ 14:58 admin
29 March, 2013 @ 14:44 admin
29 March, 2013 @ 14:44 admin
29 March, 2013 @ 14:41 admin
29 March, 2013 @ 14:29 admin
28 March, 2013 @ 20:58 admin
28 March, 2013 @ 20:55 admin
19 March, 2013 @ 14:19 admin
18 March, 2013 @ 16:57 admin
18 March, 2013 @ 15:16 admin
8 March, 2013 @ 19:46 admin
8 March, 2013 @ 19:44 admin
8 March, 2013 @ 19:41 admin
8 March, 2013 @ 19:36 admin
8 March, 2013 @ 19:36 admin
8 March, 2013 @ 19:35 admin
8 March, 2013 @ 19:31 admin
8 March, 2013 @ 19:30 admin
8 March, 2013 @ 16:26 admin
8 March, 2013 @ 16:24 admin
8 March, 2013 @ 15:32 admin
7 March, 2013 @ 20:50 admin
7 March, 2013 @ 20:32 admin
7 March, 2013 @ 17:34 admin
7 March, 2013 @ 17:34 admin
6 March, 2013 @ 23:30 admin
6 March, 2013 @ 23:26 admin
6 March, 2013 @ 23:04 admin
6 March, 2013 @ 21:49 admin
6 March, 2013 @ 21:49 admin