Catlike Coding
Unity Code Documentation
|
TextRenderer that uses a dynamically-growing mesh to show sprites. More...
Inherits CatlikeCoding.TextBox.TextRenderer.
Inherited by CatlikeCoding.TextBox.TextMeshCircleRenderer, CatlikeCoding.TextBox.TextMeshCylinderRenderer, and CatlikeCoding.TextBox.TextMeshTorusRenderer.
Public Member Functions | |
override void | Add (CharMetaData meta, Vector2 offset) |
Add a character. More... | |
override void | Apply () |
Perform any work that needs to be done after character have been added. More... | |
override void | Prepare () |
Perform any work that needs to be done before characters will be added, like clearing old data. More... | |
override void | SetClipBounds (Bounds2D clipBounds) |
Perform any work to support clipping. More... | |
Public Attributes | |
int | chunkSize = 1 |
The mesh will grow in multiples of the chunk size. Smaller produces less overshoot but potentially more frequent resizing. More... | |
TextMeshRendererUV2Mode | uv2Mode |
UV2 mode. More... | |
Public Attributes inherited from CatlikeCoding.TextBox.TextRenderer | |
int | renderedCharCount |
How many characters to render. Will be set before Prepare is called. More... | |
TextBox | textBox |
Text box that uses the renderer. More... | |
Protected Member Functions | |
void | OnDestroy () |
Called by Unity when the component is destroyed. More... | |
Protected Attributes | |
Color32[] | colors |
Mesh colors. More... | |
int | currentVertexIndex |
Increased by 4 after each call to Add. More... | |
int | lastRendererCharCount |
Set equal to renderedCharCount after Apply. More... | |
Mesh | mesh |
Mesh used to render the characters. More... | |
bool | meshResized |
Whether the mesh has been resized during Prepare. More... | |
int[] | triangles |
Mesh triangles. More... | |
Vector2[] | uv |
Mesh UV. More... | |
Vector2[] | uv2 |
Mesh UV2. Might not exist. More... | |
Vector3[] | vertices |
Mesh vertices. More... | |
Static Protected Attributes | |
static Vector3 | hidden = Vector3.zero |
Quick vector access for hiding unused sprites. More... | |
Properties | |
override Bounds | Bounds [get] |
Get the 3D bounds of the rendered content. More... | |
Properties inherited from CatlikeCoding.TextBox.TextRenderer | |
virtual Bounds | Bounds [get] |
Get the 3D bounds of the rendered content. More... | |
TextRenderer that uses a dynamically-growing mesh to show sprites.
This component can be extended to add things like secondary UV. The vertex order of sprites is 0 top left, 1 top right, 2 bottom right, and 3 bottom left. The triangle order of sprites is 0, 1, 3 and 0, 2, 3.
|
virtual |
Add a character.
meta | Character meta data. |
offset | Additional offset. |
Reimplemented from CatlikeCoding.TextBox.TextRenderer.
|
virtual |
Perform any work that needs to be done after character have been added.
Reimplemented from CatlikeCoding.TextBox.TextRenderer.
Reimplemented in CatlikeCoding.TextBox.TextMeshTorusRenderer.
|
protected |
Called by Unity when the component is destroyed.
|
virtual |
Perform any work that needs to be done before characters will be added, like clearing old data.
Reimplemented from CatlikeCoding.TextBox.TextRenderer.
|
virtual |
Perform any work to support clipping.
It is up to subclasses whether they support clipping.
clipBounds | Clip bounds. |
Reimplemented from CatlikeCoding.TextBox.TextRenderer.
int CatlikeCoding.TextBox.TextMeshRenderer.chunkSize = 1 |
The mesh will grow in multiples of the chunk size. Smaller produces less overshoot but potentially more frequent resizing.
|
protected |
Mesh colors.
|
protected |
Increased by 4 after each call to Add.
|
staticprotected |
Quick vector access for hiding unused sprites.
|
protected |
Set equal to renderedCharCount after Apply.
|
protected |
Mesh used to render the characters.
|
protected |
Whether the mesh has been resized during Prepare.
|
protected |
Mesh triangles.
|
protected |
Mesh UV.
|
protected |
Mesh UV2. Might not exist.
TextMeshRendererUV2Mode CatlikeCoding.TextBox.TextMeshRenderer.uv2Mode |
UV2 mode.
|
protected |
Mesh vertices.
|
get |
Get the 3D bounds of the rendered content.
Returns the bounds of the used mesh, or zero if it doesn't exist yet.