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 (DynamicMesh parentMesh)
 Creates a new block that belongs to a given mesh. More...
 
bool Overlaps (MeshBlock block)
 
void AddToParent ()
 Adds this block to the parent meshes linked list. Call this during a reflow to reuse this same block again. More...
 
void SetColour (Color colour)
 Sets the vertex colours of this block. More...
 
void Layout ()
 Writes the vertices to the meshes buffer. Called during a layout event. 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 (float location)
 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 Paint ()
 Writes out the UV and vertex colours to the meshes buffers. More...
 

Public Attributes

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...
 
int VertexIndex
 The index of the first vertex in the meshes vertex array. More...
 
MeshBlock BlockAfter
 Blocks are stored as a linked list. This is the block following this one. More...
 
DynamicMesh ParentMesh
 The dynamic mesh that this block was Allocated from. More...
 
Transformation Transform
 The transform to apply to this blocks vertices as a post process. More...
 
MeshBlock LocalBlockAfter
 The block following this one in a display property linked list. More...
 

Private Member 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...
 

Static Private Attributes

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

Constructor & Destructor Documentation

PowerUI.MeshBlock.MeshBlock ( DynamicMesh  parentMesh)
inline

Creates a new block that belongs to a given mesh.

Parameters
parentMeshThe mesh the block will belong to.

Member Function Documentation

void PowerUI.MeshBlock.AddToParent ( )
inline

Adds this block to the parent meshes linked list. Call this during a reflow to reuse this same block again.

void PowerUI.MeshBlock.ApplyOutline ( float  location)
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 
)
inlineprivate

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.Layout ( )
inline

Writes the vertices to the meshes buffer. Called during a layout event.

bool PowerUI.MeshBlock.Overlaps ( MeshBlock  block)
inline
void PowerUI.MeshBlock.Paint ( )
inline

Writes out the UV and vertex colours to the meshes buffers.

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.

Member Data Documentation

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

Blocks are stored as a linked list. This is the block following this one.

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.

MeshBlock PowerUI.MeshBlock.LocalBlockAfter

The block following this one in a display property linked list.

DynamicMesh PowerUI.MeshBlock.ParentMesh

The dynamic mesh that this block was Allocated from.

UVBlock PowerUI.MeshBlock.TextUV

The UV coordinate block for a letter off the atlas.

Transformation PowerUI.MeshBlock.Transform

The transform to apply to this blocks vertices as a post process.

Vector3 PowerUI.MeshBlock.VertexBottomLeft

The vertex in the bottom left corner.

Vector3 PowerUI.MeshBlock.VertexBottomRight

The vertex in the bottom right corner.

int PowerUI.MeshBlock.VertexIndex

The index of the first vertex in the meshes vertex array.

Vector3 PowerUI.MeshBlock.VertexTopLeft

The vertex in the top left corner.

Vector3 PowerUI.MeshBlock.VertexTopRight

The vertex in the top right corner.