This helps 'render' elements from the DOM into a set of 3D meshes. It also performs things such as alignment and line packing.
Public Member Functions | |
Renderman (WorldUI worldUI) | |
Creates a new renderer for rendering in the world. More... | |
Renderman () | |
Creates a new renderer and a new document. More... | |
Renderman (ReflowDocument root) | |
Creates a new renderer with the given document. More... | |
Renderman (bool aot) | |
Creates a renderman for use in the Editor with AOT compiling Nitro. More... | |
void | SetInputMode (bool acceptInput) |
Called when the physics input mode changes. Ensures all batches in this renderer are on the correct new input mode. More... | |
void | RelocateCollider () |
Figures out where the box collider should be if we're in physics mode. More... | |
void | IncreaseDepth () |
Increases the current depth value. More... | |
void | Destroy () |
Destroys this renderman when it's no longer needed. More... | |
void | SetupBatchGI (DisplayableProperty property, TextureAtlas graphics, TextureAtlas font) |
Sets up the current batch as a 'globally isolated' batch. This acts like a hybrid between isolated and shared. More... | |
void | SetupBatch (DisplayableProperty property, TextureAtlas graphics, TextureAtlas font) |
Sets up the current batch based on the isolation settings requested by a property. More... | |
void | AddBatch (UIBatch batch) |
Adds the given batch to the main linked list for processing. More... | |
LineBoxMeta | BeginLines (RenderableData renderable, VirtualElements virts, LayoutBox box, bool autoWidth) |
Sets up this renderer so that it's ready to start packing child elements of a given element into lines. More... | |
void | EndLines (LineBoxMeta lineZone, VirtualElements virts, LayoutBox box) |
Lets the renderer know that the given parent element has finished packing all of its kids. This allows alignment to occur next. More... | |
bool | IsInvisible (float left, float top, float width, float height) |
Checks if the given box coordinates are outside the current clipping boundary. If they are, the box is considered invisible. More... | |
void | SetBoundary (ComputedStyle computed, LayoutBox box) |
Sets the clipping boundary from the given computed style. More... | |
void | ResetBoundary () |
Resets the clipping boundary back to the whole screen. More... | |
void | Reset () |
Resets all values in the renderer. Called before each layout. More... | |
void | RenderWithCamera (int id) |
Puts all batches of this renderer into the given unity layer. More... | |
void | RequestLayout () |
Asks the renderer to perform a layout next update. More... | |
void | RequestUpdate (Css.RenderableData style, UpdateMode mode) |
Asks the renderer to perform a paint on the given style object next update. More... | |
void | Update () |
Update causes all changes to be applied and layouts to occur. More... | |
void | PoolBoxes (LayoutBox firstBox, LayoutBox lastBox) |
Adds a linked list of boxes to the box pool. More... | |
LayoutBox | PooledBox () |
Gets a box from the pool or creates one. More... | |
void | Layout () |
Relocates all DOM elements by calculating their onscreen position. Each element may allocate sections of the 3D mesh (blocks) which are then flushed out into the unity mesh and onto the screen. More... | |
Vector3 | PixelToWorldUnit (float px, float py, float depth) |
Converts the given screen coordinate to world coordinates. More... | |
Public Attributes | |
int | RenderQueue =3000 |
The starting offset for all batches. More... | |
float | Depth =0f |
The current depth the rendering is occuring at. More... | |
float | MaxDepth =0f |
The deepest element rendered so far. More... | |
bool | DepthUsed |
Set to true when an element has been placed in the depth buffer. More... | |
UpdateMode | HighestUpdateMode =UpdateMode.None |
The "highest" update mode used. More... | |
Color | ColorOverlay =Color.white |
A colour that is applied over the top of this element. More... | |
Stack< RenderableData > | FlowRootAncestors =new Stack<RenderableData>() |
The nearest outer block ancestors or inner flow root (block, inline-block, table etc). More... | |
Stack< RenderableData > | PositionedAncestors =new Stack<RenderableData>() |
The nearest positioned (non 'static') ancestor. If this is null, use the viewport. More... | |
Stack< RenderableData > | TransformedAncestors =new Stack<RenderableData>() |
The nearest transformed ancestor. If this is null, use the viewport. More... | |
TransformationStack | Transformations =new TransformationStack() |
A stack of transformations to apply to elements. Updated during a layout event. More... | |
UIBatch | CurrentBatch |
The batch that we are currently rendering to. More... | |
BoxRegion | ClippingBoundary |
The active clipping boundary. Usually the bounds of the parent element. More... | |
int | BatchDepth |
Essentially counts how many batches were issued. Used to define the render order. More... | |
float | FontAliasingTop |
The current top font aliasing value. More... | |
float | FontAliasingBottom |
The current bottom font aliasing value. More... | |
int | RenderLayer |
The unity layer that all meshes should go into. More... | |
bool | LayoutOccuring |
A flag which notes if the vital parts of a layout are occuring. During this, the DOM delays updates. More... | |
UIBatch | LastBatch |
The tail of the batch linked list. More... | |
UIBatch | FirstBatch |
The head of the batch linked list. More... | |
ReflowDocument | RootDocument |
The base document being rendered. More... | |
float | DepthResolution =0.05f |
How far apart along z elements are placed on the UI. More... | |
bool | DoLayout |
True if a layout event was requested. More... | |
RenderableData | StylesToUpdate |
The start of a linked list of styles that need to be painted. This linked list helps prevent layouts occuring as many updates only affect the appearance. More... | |
ElementStyle | StylesToRecompute |
The start of a linked list of styles that need to be recomputed. More... | |
GameObject | Node |
An optional gameobject to parent all content to. More... | |
bool | ScreenClip =true |
True if the screen should clip this renderer. More... | |
WorldUI | InWorldUI |
Used if this renderer is generating a UI in the game world (e.g. on a billboard). More... | |
int | StallStatus |
Used to halt the renderer from rendering anything else of a child (or anything else of a document etc). More... | |
ShaderSet | CurrentShaderSet |
The active shader set. Expected to never be null. More... | |
Transform | PhysicsModeCollider |
The transform of a gameobject containing a cube collider. More... | |
MeshBlock | Block |
A shared block used as an interface for reading/ writing from meshes. More... | |
int | Segment =LineBoxSegment.All |
The segment to draw. Used by inline elements when they're drawing e.g. a border. More... | |
SparkInformerNode | FirstInformer |
A list of 'active' informers. Used by special effects like first-line. More... | |
Stack< LineBoxMeta > | BoxStack =new Stack<LineBoxMeta>() |
The current stack of boxes that we're working on. More... | |
BlockBoxMeta | LastBlockBox |
InputGrid | InputGrid =new InputGrid() |
A fast grid for input lookups. More... | |
BoxRegion | ScreenViewport =new BoxRegion() |
The root screen viewport. More... | |
BoxRegion | Viewport |
The current viewport. Note that this changes whenever a new document starts rendering (such as inside an iframe). More... | |
LayoutBox | LastBoxPool |
A pool of layout boxes. More... | |
LayoutBox | FirstBoxPool |
A pool of layout boxes. More... | |
Package Attributes | |
bool | FullReflow |
True if this renderer is performing a complete reflow. More... | |
bool | ViewportBackground |
True if we've handled the viewport background (originates from the first of either html or body). More... | |
SparkInformerNode | FirstLetter |
The informer for the first-letter CSS selector. If it's not null then a text node will deal with it. More... | |
SparkInformerNode | FirstLine |
The informer for the first-line CSS selector. More... | |
int | CharacterIndex |
LayoutBox | CurrentBox |
Color | FontColour |
BoxRegion | CurrentRegion |
float | TopOffset |
float | TextScaleFactor |
float | TextAscender |
float | TextDepth |
Properties | |
Transformation | Transform [get] |
The active transformation. More... | |
bool | RenderingInWorld [get] |
Is this a renderer for a WorldUI? More... | |
GameObject | Parent [get] |
Gets the parent gameobject for this renderman, if there is one. More... | |
RenderMode | RenderMode [get, set] |
How this renderman renders images; either on an atlas or with them 'as is'. More... | |
FilterMode | FilterMode [get, set] |
The image filter mode. If you're using lots of WorldUI's or animations its best to have this on bilinear. More... | |
LineBoxMeta | TopOfStack [get] |
The current box meta on the TOS. More... | |
LineBoxMeta | TopOfStackSafe [get] |
The current box meta on the TOS. More... | |
RenderableData | FlowRootAncestor [get] |
Nearest flow root. Null if you should use viewport. More... | |
RenderableData | PositionedAncestor [get] |
Nearest positioned ancestor. Null if you should use viewport. More... | |
RenderableData | TransformedAncestor [get] |
Nearest transformed ancestor. Null if you should use viewport. More... | |
float | MaxX [get] |
The max Y value. Essentially the virtual screens width. More... | |
float | MaxY [get] |
The max Y value. Essentially the virtual screens height. More... | |
int | Layer [get, set] |
The layer to put this Renderer in. Simply an alias for RenderWithCamera. More... | |
Private Member Functions | |
void | Init () |
Sets up this renderman. More... | |
Private Attributes | |
FilterMode | ImageFilterMode =FilterMode.Point |
The default filtering mode used by all images of this renderer. More... | |
Static Private Attributes | |
static RenderMode | UIRenderMode =RenderMode.Atlas |
How this renderman renders images; either on an atlas or with them 'as is'. More... | |
|
inline |
Creates a new renderer for rendering in the world.
|
inline |
Creates a new renderer and a new document.
|
inline |
Creates a new renderer with the given document.
|
inline |
Creates a renderman for use in the Editor with AOT compiling Nitro.
|
inline |
Adds the given batch to the main linked list for processing.
|
inline |
Sets up this renderer so that it's ready to start packing child elements of a given element into lines.
renderable | The parent render data whose children will be packed. |
|
inline |
Destroys this renderman when it's no longer needed.
|
inline |
Lets the renderer know that the given parent element has finished packing all of its kids. This allows alignment to occur next.
renderable | The element that is done packing. |
|
inline |
Increases the current depth value.
|
inlineprivate |
Sets up this renderman.
|
inline |
Checks if the given box coordinates are outside the current clipping boundary. If they are, the box is considered invisible.
left | The x coordinate of the left edge of the box in pixels from the left of the screen. |
top | The y coordinate of the top edge of the box in pixels from the top edge of the screen. |
width | The width of the box. |
height | The height of the box (extends down the screen). |
|
inline |
Relocates all DOM elements by calculating their onscreen position. Each element may allocate sections of the 3D mesh (blocks) which are then flushed out into the unity mesh and onto the screen.
|
inline |
Converts the given screen coordinate to world coordinates.
px | The screen x coordinate in pixels from the left. |
py | The screen y coordinate in pixels from the top. |
depth | The z depth. |
Adds a linked list of boxes to the box pool.
|
inline |
Gets a box from the pool or creates one.
|
inline |
Figures out where the box collider should be if we're in physics mode.
|
inline |
Puts all batches of this renderer into the given unity layer.
id | The ID of the unity layer. |
|
inline |
Asks the renderer to perform a layout next update.
|
inline |
Asks the renderer to perform a paint on the given style object next update.
style | The style to paint. |
|
inline |
Resets all values in the renderer. Called before each layout.
|
inline |
Resets the clipping boundary back to the whole screen.
|
inline |
Sets the clipping boundary from the given computed style.
style | The computed style to find the clipping boundary from. |
|
inline |
Called when the physics input mode changes. Ensures all batches in this renderer are on the correct new input mode.
mode | The new input mode to use. |
|
inline |
Sets up the current batch based on the isolation settings requested by a property.
property | The displayable property which wants the batch. |
fontTexture | The font texture to use with this batch. |
|
inline |
Sets up the current batch as a 'globally isolated' batch. This acts like a hybrid between isolated and shared.
property | The displayable property which wants the batch. |
fontTexture | The font texture to use with this batch. |
|
inline |
Update causes all changes to be applied and layouts to occur.
int Css.Renderman.BatchDepth |
Essentially counts how many batches were issued. Used to define the render order.
MeshBlock Css.Renderman.Block |
A shared block used as an interface for reading/ writing from meshes.
Stack<LineBoxMeta> Css.Renderman.BoxStack =new Stack<LineBoxMeta>() |
The current stack of boxes that we're working on.
|
package |
BoxRegion Css.Renderman.ClippingBoundary |
The active clipping boundary. Usually the bounds of the parent element.
Color Css.Renderman.ColorOverlay =Color.white |
A colour that is applied over the top of this element.
UIBatch Css.Renderman.CurrentBatch |
The batch that we are currently rendering to.
|
package |
|
package |
ShaderSet Css.Renderman.CurrentShaderSet |
The active shader set. Expected to never be null.
float Css.Renderman.Depth =0f |
The current depth the rendering is occuring at.
float Css.Renderman.DepthResolution =0.05f |
How far apart along z elements are placed on the UI.
bool Css.Renderman.DepthUsed |
Set to true when an element has been placed in the depth buffer.
bool Css.Renderman.DoLayout |
True if a layout event was requested.
UIBatch Css.Renderman.FirstBatch |
The head of the batch linked list.
LayoutBox Css.Renderman.FirstBoxPool |
A pool of layout boxes.
SparkInformerNode Css.Renderman.FirstInformer |
A list of 'active' informers. Used by special effects like first-line.
|
package |
The informer for the first-letter CSS selector. If it's not null then a text node will deal with it.
|
package |
The informer for the first-line CSS selector.
Stack<RenderableData> Css.Renderman.FlowRootAncestors =new Stack<RenderableData>() |
The nearest outer block ancestors or inner flow root (block, inline-block, table etc).
float Css.Renderman.FontAliasingBottom |
The current bottom font aliasing value.
float Css.Renderman.FontAliasingTop |
The current top font aliasing value.
|
package |
|
package |
True if this renderer is performing a complete reflow.
UpdateMode Css.Renderman.HighestUpdateMode =UpdateMode.None |
The "highest" update mode used.
|
private |
The default filtering mode used by all images of this renderer.
WorldUI Css.Renderman.InWorldUI |
Used if this renderer is generating a UI in the game world (e.g. on a billboard).
UIBatch Css.Renderman.LastBatch |
The tail of the batch linked list.
BlockBoxMeta Css.Renderman.LastBlockBox |
LayoutBox Css.Renderman.LastBoxPool |
A pool of layout boxes.
bool Css.Renderman.LayoutOccuring |
A flag which notes if the vital parts of a layout are occuring. During this, the DOM delays updates.
float Css.Renderman.MaxDepth =0f |
The deepest element rendered so far.
GameObject Css.Renderman.Node |
An optional gameobject to parent all content to.
Transform Css.Renderman.PhysicsModeCollider |
The transform of a gameobject containing a cube collider.
Stack<RenderableData> Css.Renderman.PositionedAncestors =new Stack<RenderableData>() |
The nearest positioned (non 'static') ancestor. If this is null, use the viewport.
int Css.Renderman.RenderLayer |
The unity layer that all meshes should go into.
int Css.Renderman.RenderQueue =3000 |
The starting offset for all batches.
ReflowDocument Css.Renderman.RootDocument |
The base document being rendered.
bool Css.Renderman.ScreenClip =true |
True if the screen should clip this renderer.
int Css.Renderman.Segment =LineBoxSegment.All |
The segment to draw. Used by inline elements when they're drawing e.g. a border.
int Css.Renderman.StallStatus |
Used to halt the renderer from rendering anything else of a child (or anything else of a document etc).
ElementStyle Css.Renderman.StylesToRecompute |
The start of a linked list of styles that need to be recomputed.
RenderableData Css.Renderman.StylesToUpdate |
The start of a linked list of styles that need to be painted. This linked list helps prevent layouts occuring as many updates only affect the appearance.
|
package |
|
package |
|
package |
|
package |
TransformationStack Css.Renderman.Transformations =new TransformationStack() |
A stack of transformations to apply to elements. Updated during a layout event.
Stack<RenderableData> Css.Renderman.TransformedAncestors =new Stack<RenderableData>() |
The nearest transformed ancestor. If this is null, use the viewport.
|
staticprivate |
How this renderman renders images; either on an atlas or with them 'as is'.
BoxRegion Css.Renderman.Viewport |
The current viewport. Note that this changes whenever a new document starts rendering (such as inside an iframe).
|
package |
True if we've handled the viewport background (originates from the first of either html or body).
|
getset |
The image filter mode. If you're using lots of WorldUI's or animations its best to have this on bilinear.
|
get |
Nearest flow root. Null if you should use viewport.
|
getset |
The layer to put this Renderer in. Simply an alias for RenderWithCamera.
|
get |
The max Y value. Essentially the virtual screens width.
|
get |
The max Y value. Essentially the virtual screens height.
|
get |
Gets the parent gameobject for this renderman, if there is one.
|
get |
Nearest positioned ancestor. Null if you should use viewport.
|
get |
Is this a renderer for a WorldUI?
|
getset |
How this renderman renders images; either on an atlas or with them 'as is'.
|
get |
The current box meta on the TOS.
|
get |
The current box meta on the TOS.
|
get |
The active transformation.
|
get |
Nearest transformed ancestor. Null if you should use viewport.