Home › Page › UghCamera

UghCamera

Revision for “UghCamera” created on 17 April, 2013 @ 17:57

Title
UghCamera
Content
Inherits from MonoBehaviour The UghCamera renders everything in the Ugh GUI_LAYER (by default, Unity layer 20.) It is an orthographic Camera that automatically resets its position to (0, 0, -10) pointing towards (0, 0, 0). UghCamera is a smart object that will instantiate itself when needed.  (You should never have to manually add an UghCamera to a scene.) [table caption="Variables" colwidth="20%|20%"] name, type, description Aspect, float, The aspect ratio of the UghCamera as rise over run. CameraPixelSize, Vector3, The x and y elements define the width and height of the screen in pixels. guiLayer, int, Holds current layer value that the Camera will render.  See GUI_LAYER below. ScreenExtents, Vector3, The x and y elements define the half-width and half-height of the screen in Unity units. ScreenSize, Vector3,The x and y elements define the width and height of the screen in Unity units. [/table] [table caption="Functions" colwidth="20%|20%"] name, type, description ScreenAnchorToPosition, Vector3, "Returns a position, in Unity units, that corresponds to an anchor location on the screen." [/table] [table caption="Class Variables" colwidth="20%|20%"] name, type, description Instance, UghCamera, "Returns the instance of the UghCamera in the scene, or null if none is present" GUI_LAYER, const int, The Unity layer that all UghCamera instance will render.  (Defaults to 20.) PixelsPerUnit, float, The number of pixels contained in the span of a single Unity unit. [/table] _ <strong>Using UghCamera's Class Functions</strong> [sourcecode language="csharp"]public Vector3 ScreenAnchorToPosition(UghSprite.Anchor anchor, Vector3 customAnchor)[/sourcecode] Given an Anchor and a custom offset, this function will return a position, in Unity units, that corresponds to the location of the Anchor as it relates to the UghCamera. For example <code>ScreenAncorToPosition(UghSprite.Anchor.TopCenter, Vector3.zero)</code> will return a position that is at the top and center of the UghCamera's rendered surface. (An UghSprite placed at this position will appear at the top and center of the screen.)
Excerpt


OldNewDate CreatedAuthorActions
17 April, 2013 @ 17:57 admin
2 April, 2013 @ 17:12 [Autosave] admin
2 April, 2013 @ 17:11 admin
29 March, 2013 @ 15:06 admin
28 March, 2013 @ 21:00 admin
28 March, 2013 @ 21:00 admin
28 March, 2013 @ 21:00 admin
28 March, 2013 @ 20:59 admin
28 March, 2013 @ 20:59 admin
28 March, 2013 @ 20:58 admin
28 March, 2013 @ 20:58 admin
28 March, 2013 @ 20:51 admin
28 March, 2013 @ 20:48 admin
28 March, 2013 @ 20:45 admin
28 March, 2013 @ 20:44 admin
18 March, 2013 @ 20:44 admin
18 March, 2013 @ 16:02 admin
18 March, 2013 @ 15:25 admin
18 March, 2013 @ 15:09 admin
18 March, 2013 @ 15:08 admin
18 March, 2013 @ 15:08 admin
8 March, 2013 @ 21:30 admin
8 March, 2013 @ 21:30 admin
8 March, 2013 @ 21:27 admin
8 March, 2013 @ 15:32 admin
8 March, 2013 @ 15:32 admin
8 March, 2013 @ 15:31 admin
7 March, 2013 @ 22:02 admin
7 March, 2013 @ 21:53 admin
6 March, 2013 @ 21:49 admin
6 March, 2013 @ 21:49 admin