Detailed Description

A block of two triangles in a dynamic mesh. The triangles are positioned to create a flat 2D rectangle. The colour and position can be adjusted to fit content onto the block.

Public Member Functions

 MeshBlock (Renderman renderer)
 
void SetBatchIndex (UIBatch batch, int blockIndex)
 Sets an index in a batch. Used in paint mode. More...
 
void SetColour (Color colour)
 Sets the vertex colours of this block. More...
 
void SetClipped (BoxRegion boundary, BoxRegion block, Renderman renderer, float zIndex)
 Sets the vertices of this box to that specified by the given block but clipped to fit within a boundary. More...
 
UVBlock SetClipped (BoxRegion boundary, BoxRegion block, Renderman renderer, float zIndex, AtlasLocation imgLocation, UVBlock uvBlock)
 Sets the vertices of this box to that specified by the given block but clipped to fit within a boundary. At the same time, an image is applied to the block and its UV coordinates are also clipped. More...
 
void ApplyOutline ()
 Applies the SDF outline "location", essentially the thickness of an outline, to this block. More...
 
void SetSolidColourUV ()
 Sets the UV and image on this block to that of the solid colour pixel. More...
 
void Next ()
 Advances to the following block. More...
 
void TransformVertices (Matrix4x4 delta)
 Applies the given delta matrix to the verts. More...
 
void PaintColour (Color colour)
 Writes out the given colour right now. More...
 
void Done (Transformation transform)
 Writes out the data to the meshes buffers. More...
 

Public Attributes

int BlockIndex
 The index of this block in the buffer. More...
 
BlockBuffer Buffer
 The buffer that the current block is from. More...
 
Color Colour
 The colour of the whole block. Applied to vertex colours. More...
 
UVBlock TextUV
 The UV coordinate block for a letter off the atlas. More...
 
UVBlock ImageUV
 The UV coordinate for an image off the atlas. More...
 
Vector3 VertexTopLeft
 The vertex in the top left corner. More...
 
Vector3 VertexTopRight
 The vertex in the top right corner. More...
 
Vector3 VertexBottomLeft
 The vertex in the bottom left corner. More...
 
Vector3 VertexBottomRight
 The vertex in the bottom right corner. More...
 
readonly Renderman Renderer
 The renderer used by this meshblock. More...
 

Package Functions

void ApplyVertices (BoxRegion block, Renderman renderer, float zIndex)
 This locates the vertices of this block in world space to the position defined by the given box. More...
 

Properties

int VertexIndex [get]
 The index of the first vertex in the buffer. More...
 
int TriangleIndex [get]
 The first triangle index. More...
 

Private Attributes

DynamicMesh Mesh
 The batch mesh. Used in paint mode instead of Buffer. More...
 

Static Private Attributes

static UVBlock BlankUV =new UVBlock(2f,2f,2f,2f)
 

Constructor & Destructor Documentation

PowerUI.MeshBlock.MeshBlock ( Renderman  renderer)
inline

Member Function Documentation

void PowerUI.MeshBlock.ApplyOutline ( )
inline

Applies the SDF outline "location", essentially the thickness of an outline, to this block.

void PowerUI.MeshBlock.ApplyVertices ( BoxRegion  block,
Renderman  renderer,
float  zIndex 
)
inlinepackage

This locates the vertices of this block in world space to the position defined by the given box.

Parameters
blockThe position of the vertices in screen coordinates.
rendererThe renderer used when rendering this block.
zIndexThe depth of the vertices.
void PowerUI.MeshBlock.Done ( Transformation  transform)
inline

Writes out the data to the meshes buffers.

void PowerUI.MeshBlock.Next ( )
inline

Advances to the following block.

void PowerUI.MeshBlock.PaintColour ( Color  colour)
inline

Writes out the given colour right now.

void PowerUI.MeshBlock.SetBatchIndex ( UIBatch  batch,
int  blockIndex 
)
inline

Sets an index in a batch. Used in paint mode.

void PowerUI.MeshBlock.SetClipped ( BoxRegion  boundary,
BoxRegion  block,
Renderman  renderer,
float  zIndex 
)
inline

Sets the vertices of this box to that specified by the given block but clipped to fit within a boundary.

Parameters
boundaryThe clipping boundary. The vertices will be clipped to within this.
blockThe position of the vertices.
zIndexThe depth of the vertices.
UVBlock PowerUI.MeshBlock.SetClipped ( BoxRegion  boundary,
BoxRegion  block,
Renderman  renderer,
float  zIndex,
AtlasLocation  imgLocation,
UVBlock  uvBlock 
)
inline

Sets the vertices of this box to that specified by the given block but clipped to fit within a boundary. At the same time, an image is applied to the block and its UV coordinates are also clipped.

Parameters
boundaryThe clipping boundary. The vertices will be clipped to within this.
blockThe position of the vertices.
rendererThe renderer that will render this block.
zIndexThe depth of the vertices.
imgLocationThe location of the image on the meshes atlas.
void PowerUI.MeshBlock.SetColour ( Color  colour)
inline

Sets the vertex colours of this block.

Parameters
colourThe colour to set them to.
void PowerUI.MeshBlock.SetSolidColourUV ( )
inline

Sets the UV and image on this block to that of the solid colour pixel.

void PowerUI.MeshBlock.TransformVertices ( Matrix4x4  delta)
inline

Applies the given delta matrix to the verts.

Member Data Documentation

UVBlock PowerUI.MeshBlock.BlankUV =new UVBlock(2f,2f,2f,2f)
staticprivate
int PowerUI.MeshBlock.BlockIndex

The index of this block in the buffer.

BlockBuffer PowerUI.MeshBlock.Buffer

The buffer that the current block is from.

Color PowerUI.MeshBlock.Colour

The colour of the whole block. Applied to vertex colours.

UVBlock PowerUI.MeshBlock.ImageUV

The UV coordinate for an image off the atlas.

DynamicMesh PowerUI.MeshBlock.Mesh
private

The batch mesh. Used in paint mode instead of Buffer.

readonly Renderman PowerUI.MeshBlock.Renderer

The renderer used by this meshblock.

UVBlock PowerUI.MeshBlock.TextUV

The UV coordinate block for a letter off the atlas.

Vector3 PowerUI.MeshBlock.VertexBottomLeft

The vertex in the bottom left corner.

Vector3 PowerUI.MeshBlock.VertexBottomRight

The vertex in the bottom right corner.

Vector3 PowerUI.MeshBlock.VertexTopLeft

The vertex in the top left corner.

Vector3 PowerUI.MeshBlock.VertexTopRight

The vertex in the top right corner.

Property Documentation

int PowerUI.MeshBlock.TriangleIndex
get

The first triangle index.

int PowerUI.MeshBlock.VertexIndex
get

The index of the first vertex in the buffer.