NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIGeometry Class Reference

Generated geometry class. All widgets have one. This class separates the geometry creation into several steps, making it possible to perform actions selectively depending on what has changed. For example, the widget doesn't need to be rebuilt unless something actually changes, so its geometry can be cached. Likewise, the widget's transformed coordinates only change if the widget's transform moves relative to the panel, so that can be cached as well. In the end, using this class means using more memory, but at the same time it allows for significant performance gains, especially when using widgets that spit out a lot of vertices, such as UILabels. More...

Public Member Functions

void Clear ()
 Step 1: Prepare to fill the buffers – make them clean and valid. More...
 
void ApplyTransform (Matrix4x4 widgetToPanel)
 Step 2: Transform the vertices by the provided matrix. More...
 
void WriteToBuffers (BetterList< Vector3 > v, BetterList< Vector2 > u, BetterList< Color32 > c, BetterList< Vector3 > n, BetterList< Vector4 > t)
 Step 3: Fill the specified buffer using the transformed values. More...
 

Public Attributes

BetterList< Vector3 > verts = new BetterList<Vector3>()
 Widget's vertices (before they get transformed). More...
 
BetterList< Vector2 > uvs = new BetterList<Vector2>()
 Widget's texture coordinates for the geometry's vertices. More...
 
BetterList< Color32 > cols = new BetterList<Color32>()
 Array of colors for the geometry's vertices. More...
 

Properties

bool hasVertices [get]
 Whether the geometry contains usable vertices. More...
 
bool hasTransformed [get]
 Whether the geometry has usable transformed vertex data. More...
 

Detailed Description

Generated geometry class. All widgets have one. This class separates the geometry creation into several steps, making it possible to perform actions selectively depending on what has changed. For example, the widget doesn't need to be rebuilt unless something actually changes, so its geometry can be cached. Likewise, the widget's transformed coordinates only change if the widget's transform moves relative to the panel, so that can be cached as well. In the end, using this class means using more memory, but at the same time it allows for significant performance gains, especially when using widgets that spit out a lot of vertices, such as UILabels.

Member Function Documentation

void UIGeometry.ApplyTransform ( Matrix4x4  widgetToPanel)

Step 2: Transform the vertices by the provided matrix.

void UIGeometry.Clear ( )

Step 1: Prepare to fill the buffers – make them clean and valid.

void UIGeometry.WriteToBuffers ( BetterList< Vector3 >  v,
BetterList< Vector2 >  u,
BetterList< Color32 >  c,
BetterList< Vector3 >  n,
BetterList< Vector4 >  t 
)

Step 3: Fill the specified buffer using the transformed values.

Member Data Documentation

BetterList<Color32> UIGeometry.cols = new BetterList<Color32>()

Array of colors for the geometry's vertices.

BetterList<Vector2> UIGeometry.uvs = new BetterList<Vector2>()

Widget's texture coordinates for the geometry's vertices.

BetterList<Vector3> UIGeometry.verts = new BetterList<Vector3>()

Widget's vertices (before they get transformed).

Property Documentation

bool UIGeometry.hasTransformed
get

Whether the geometry has usable transformed vertex data.

bool UIGeometry.hasVertices
get

Whether the geometry contains usable vertices.


The documentation for this class was generated from the following file: