Detailed Description

A TRP for rendering text in 3D. Gets created when CSS text-extrude is non-zero.

Inheritance diagram for Css.TextRenderingProperty3D:
Css.TextRenderingProperty Css.DisplayableProperty

Public Member Functions

 TextRenderingProperty3D (RenderableData data)
 Creates a new text rendering property. Note that this must not be called directly. Set content: instead; if you're doing that from a tag, take a look at BR. More...
 
override void Paint (LayoutBox box, Renderman renderer)
 Called when a paint event occurs. Paint events don't relocate the whole UI so are quick and efficient. More...
 
override void RequestPaint ()
 Requests for a paint event to occur. Note that paint events are more efficient than a layout as they only refresh the mesh colours and uvs rather than the whole mesh. More...
 
override void DrawUnderline (Renderman renderer)
 Draws an underline (or a strikethrough). More...
 
- Public Member Functions inherited from Css.TextRenderingProperty
 TextRenderingProperty (RenderableData data)
 Creates a new text rendering property. Note that this must not be called directly More...
 
void Setup (ComputedStyle style)
 Applies this TRP to the given computed style. Only ever used by the "content" CSS property. More...
 
int LetterCount ()
 Gets how many letters are being rendered. More...
 
void FontLoaded (DynamicFont font)
 Called when an -face font fully loads. More...
 
void ClearDimensions ()
 Clears the computed dimensions so they'll get recalculated during the layout pass. More...
 
void ClearText ()
 
int LetterIndex (float widthOffset)
 Gets the letter at the given local position in pixels. More...
 
float PositionOf (int letterID)
 Gets the horizontal position in pixels of the numbered letter. More...
 
float LocalPositionOf (int letterID)
 Gets the horizontal position in pixels of the numbered letter relative to this element. More...
 
void DrawEmoji (Glyph character, ref float left, Renderman renderer)
 Draws the given Emoji character. More...
 
- Public Member Functions inherited from Css.DisplayableProperty
 DisplayableProperty (RenderableData data)
 Creates a new displayable property for the given render data. More...
 
MeshBlock GetFirstBlock (Renderman renderer)
 Gets the first rendered block of this property. Used during Paint passes. More...
 
void SetVisibility (bool visible)
 Call this when the visibility of this property as a whole changes. More...
 
virtual void OnBatchDestroy ()
 Called when the isolation batch for this property gets removed. More...
 
void Change (string property, Value newValue)
 Called when a named css property changes. More...
 
void ClearBlocks ()
 Clears all mesh blocks that this property has allocated. More...
 
void WentOffScreen ()
 
virtual bool Render (bool first, LayoutBox box, Renderman renderer)
 Make this property visible by forcing it to redraw. More...
 
virtual void ApplyTransform (Matrix4x4 delta, Renderman renderer)
 Transforms all the verts by the given delta matrix. Used during a Paint only. More...
 
void SetBatchMaterial (Renderman renderer, Material material)
 Sets the current batches material. More...
 
void RequestLayout ()
 Requests for a layout event to occur. Note that paint events are more efficient than a layout as they only refresh the mesh colours and uvs rather than the whole mesh. More...
 
MeshBlock Add (Renderman renderer)
 
virtual void PostProcess (LayoutBox box, Renderman renderer)
 Called after a render pass. More...
 
void Isolate ()
 Isolates this property from the rest of the UI such that it can have a custom mesh/shader/texture etc. More...
 
void Include ()
 Reverses Css.DisplayableProperty.Isolate by re-including this property in the main UI batch. More...
 
bool IsIsolated ()
 Checks if this is an isolated property - that's one which is seperate and takes its own drawcall. More...
 
AtlasLocation RequireImage (AtlasEntity image)
 

Public Attributes

MeshBufferExtruded Mesh
 The computed 3D extruded text, if there is any. More...
 
MeshBufferExtruded Underline
 The computed 3D extruded underline, if there is one. More...
 
float Extrude
 How far this text is being extruded. More...
 
- Public Attributes inherited from Css.TextRenderingProperty
float FontSize
 The size of the font in pixels. More...
 
float FontSizeAdjust =-1f
 The font-size adjustment. -1 is none. More...
 
Color BaseColour
 The colour that the font should be without the colour overlay. More...
 
float Alias =float.MaxValue
 Should text be automatically aliased? Auto is MaxValue. Set with font-smoothing. More...
 
bool AllEmpty
 True if all characters are whitespaces. No batches will be generated. More...
 
float LetterSpacing
 Additional spacing to apply around letters. More...
 
float WordSpacing
 Additional spacing to apply around words. More...
 
bool OverflowWrapActive
 Overflow wrap active. More...
 
TextDecorationInfo TextLine
 How and where a line should be drawn if at all (e.g. underline, overline etc.) More...
 
Glyph[] Characters
 The set of characters to render. Note that the characters are shared globally. More...
 
float LineHeightOffset
 The line height offset. More...
 
- Public Attributes inherited from Css.DisplayableProperty
bool Visible
 True if this is currently visible on screen. More...
 
bool Isolated
 True if this property is isolated and has a seperate mesh and material from everything else. More...
 
short BlockCount
 The number of mesh blocks that this property has allocated. More...
 
RenderableData RenderData
 The parent render data that this is a property of. More...
 
bool GotBatchAlready
 Only applies to Isolated properties. Set to true when this property has allocated a UIBatch on the current layout. More...
 

Protected Member Functions

override void DrawInvertCharacter (ref float left, Renderman renderer)
 Draws a character with x-inverted UV's. Used for rendering e.g. "1 < 2" in right-to-left. More...
 
override void DrawCharacter (ref float left, Renderman renderer)
 Draws a character and advances the pen onwards. More...
 

Package Functions

override void NowOffScreen ()
 Called when this element goes off screen (or is removed from the DOM). More...
 
override void Layout (LayoutBox box, Renderman renderer)
 Called when a layout event occurs. Layout events relocate the whole UI so should be used less frequently than a paint event. More...
 
- Package Functions inherited from Css.TextRenderingProperty
override bool NowOnScreen ()
 Called when this element goes on screen. More...
 
void LoadCharacters (string text, RenderableData renderable)
 Loads the character array (Css.TextRenderingProperty.Characters) from the given text string. More...
 

Additional Inherited Members

- Package Attributes inherited from Css.TextRenderingProperty
FontFace FontToDraw
 The font face to use when rendering. More...
 
float[] Kerning
 Kern values for this text, if it has any. Created only if it's needed. More...
 
bool Dirty =true
 True if this needs to have its characters loaded. More...
 
- Properties inherited from Css.TextRenderingProperty
override int DrawOrder [get]
 This property's draw order. More...
 
bool NoEndingSpace [get]
 Does this word not end with a whitespace? More...
 
int EndSpaceSize [get]
 The width in pixels of the last whitespace of this element, if it's got one. More...
 

Constructor & Destructor Documentation

Css.TextRenderingProperty3D.TextRenderingProperty3D ( RenderableData  data)
inline

Creates a new text rendering property. Note that this must not be called directly. Set content: instead; if you're doing that from a tag, take a look at BR.

Parameters
dataThe renderable object that this is rendering 3D text for.

Member Function Documentation

override void Css.TextRenderingProperty3D.DrawCharacter ( ref float  left,
Renderman  renderer 
)
inlineprotectedvirtual

Draws a character and advances the pen onwards.

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.DrawInvertCharacter ( ref float  left,
Renderman  renderer 
)
inlineprotectedvirtual

Draws a character with x-inverted UV's. Used for rendering e.g. "1 < 2" in right-to-left.

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.DrawUnderline ( Renderman  renderer)
inlinevirtual

Draws an underline (or a strikethrough).

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.Layout ( LayoutBox  box,
Renderman  renderer 
)
inlinepackagevirtual

Called when a layout event occurs. Layout events relocate the whole UI so should be used less frequently than a paint event.

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.NowOffScreen ( )
inlinepackagevirtual

Called when this element goes off screen (or is removed from the DOM).

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.Paint ( LayoutBox  box,
Renderman  renderer 
)
inlinevirtual

Called when a paint event occurs. Paint events don't relocate the whole UI so are quick and efficient.

Reimplemented from Css.TextRenderingProperty.

override void Css.TextRenderingProperty3D.RequestPaint ( )
inlinevirtual

Requests for a paint event to occur. Note that paint events are more efficient than a layout as they only refresh the mesh colours and uvs rather than the whole mesh.

Reimplemented from Css.DisplayableProperty.

Member Data Documentation

float Css.TextRenderingProperty3D.Extrude

How far this text is being extruded.

MeshBufferExtruded Css.TextRenderingProperty3D.Mesh

The computed 3D extruded text, if there is any.

MeshBufferExtruded Css.TextRenderingProperty3D.Underline

The computed 3D extruded underline, if there is one.