Detailed Description

Base class for any property of an element that can be visually displayed, e.g. backgrounds and borders.

Inheritance diagram for PowerUI.Css.DisplayableProperty:
PowerUI.Css.BackgroundColour PowerUI.Css.BackgroundImage PowerUI.Css.BorderProperty PowerUI.Css.RoundBorderInverseProperty PowerUI.Css.TextRenderingProperty

Public Member Functions

 DisplayableProperty (Element element)
 Creates a new displayable property for the given element. More...
 
void SetVisibility (bool visible)
 Call this when the visibility of this property as a whole changes. More...
 
void SetOverlayColour ()
 Sets the overlay colour from the elements colour overlay property. More...
 
void ColourChanged ()
 Call this when any colour of this property has changed. More...
 
virtual void OnBatchDestroy ()
 Called when the isolation batch for this property gets removed. More...
 
virtual void SetOverlayColour (Color colour)
 Called to apply the given colour overlay to this property. 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 ()
 
Vector3 MapPX (float x, float y, float z)
 Maps the given pixel location to a world location. More...
 
void Render ()
 Make this property visible by forcing it to redraw. More...
 
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...
 
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...
 
virtual void Paint ()
 Called when a paint event occurs. Paint events don't relocate the whole UI so are quick and efficient. More...
 
MeshBlock Add ()
 Allocates a new mesh block for this property to use. Mesh blocks are the core of how PowerUI displays content. More...
 
void Transform (Transformation topTransform)
 Transforms all the blocks that this property has allocated. Note that transformations are a post process. More...
 
void ApplyTransform ()
 Applies any transforms (rotate,scale etc) now. Note that tranforms are post-processes so they are very fast and mostly done by paint events. 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 PowerUI.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...
 
void SetupBatch (TextureAtlas graphics, TextureAtlas font)
 
AtlasLocation RequireImage (AtlasEntity image)
 

Public Attributes

bool Visible
 True if this is currently visible on screen. More...
 
bool Changed
 True if this property has changed its appearance. More...
 
bool Isolated
 True if this property is isolated and has a seperate mesh and material from everything else. More...
 
int BlockCount
 The number of mesh blocks that this property has allocated. More...
 
Element Element
 The parent element that this is a property of. More...
 
MeshBlock FirstBlock
 The first mesh block that this property has allocated. This is the head of a linked list. 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

virtual bool NowOnScreen ()
 Called when this element goes on screen. More...
 
virtual void NowOffScreen ()
 Called when this element goes off screen (or is removed from the DOM). More...
 
virtual void OnChange (string property, Value newValue)
 Called when a named css property changes. More...
 
virtual void Layout ()
 Called when a layout event occurs. Layout events relocate the whole UI so should be used less frequently than a paint event. More...
 

Properties

bool Paintable [get]
 Checks if this property can be repainted. More...
 

Constructor & Destructor Documentation

PowerUI.Css.DisplayableProperty.DisplayableProperty ( Element  element)
inline

Creates a new displayable property for the given element.

Member Function Documentation

MeshBlock PowerUI.Css.DisplayableProperty.Add ( )
inline

Allocates a new mesh block for this property to use. Mesh blocks are the core of how PowerUI displays content.

void PowerUI.Css.DisplayableProperty.ApplyTransform ( )
inline

Applies any transforms (rotate,scale etc) now. Note that tranforms are post-processes so they are very fast and mostly done by paint events.

void PowerUI.Css.DisplayableProperty.Change ( string  property,
Value  newValue 
)
inline

Called when a named css property changes.

Parameters
propertyThe css property that changed.
newValueThe properties new value. It may also be null.
void PowerUI.Css.DisplayableProperty.ClearBlocks ( )
inline

Clears all mesh blocks that this property has allocated.

void PowerUI.Css.DisplayableProperty.ColourChanged ( )
inline

Call this when any colour of this property has changed.

void PowerUI.Css.DisplayableProperty.Include ( )
inline

Reverses PowerUI.Css.DisplayableProperty.Isolate by re-including this property in the main UI batch.

bool PowerUI.Css.DisplayableProperty.IsIsolated ( )
inline

Checks if this is an isolated property - that's one which is seperate and takes its own drawcall.

Returns
True if it is isolated; false otherwise.
void PowerUI.Css.DisplayableProperty.Isolate ( )
inline

Isolates this property from the rest of the UI such that it can have a custom mesh/shader/texture etc.

virtual void PowerUI.Css.DisplayableProperty.Layout ( )
inlineprotectedvirtual

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

Reimplemented in PowerUI.Css.TextRenderingProperty, PowerUI.Css.BackgroundImage, PowerUI.Css.BorderProperty, PowerUI.Css.BackgroundColour, and PowerUI.Css.RoundBorderInverseProperty.

Vector3 PowerUI.Css.DisplayableProperty.MapPX ( float  x,
float  y,
float  z 
)
inline

Maps the given pixel location to a world location.

Parameters
xThe x location of the pixel from the left of the screen.
yThe y location of the pixel from the top of the screen.
zThe depth of the pixel (already in world units).
Returns
A point in 3D that can be used as a vertex.
virtual void PowerUI.Css.DisplayableProperty.NowOffScreen ( )
inlineprotectedvirtual

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

Reimplemented in PowerUI.Css.TextRenderingProperty, and PowerUI.Css.BackgroundImage.

virtual bool PowerUI.Css.DisplayableProperty.NowOnScreen ( )
inlineprotectedvirtual

Called when this element goes on screen.

Reimplemented in PowerUI.Css.TextRenderingProperty, and PowerUI.Css.BackgroundImage.

virtual void PowerUI.Css.DisplayableProperty.OnBatchDestroy ( )
inlinevirtual

Called when the isolation batch for this property gets removed.

Reimplemented in PowerUI.Css.BackgroundImage.

virtual void PowerUI.Css.DisplayableProperty.OnChange ( string  property,
Value  newValue 
)
inlineprotectedvirtual

Called when a named css property changes.

Parameters
propertyThe css property that changed.
newValueThe properties new value. It may also be null.
virtual void PowerUI.Css.DisplayableProperty.Paint ( )
inlinevirtual

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

Reimplemented in PowerUI.Css.TextRenderingProperty, PowerUI.Css.BackgroundImage, PowerUI.Css.BorderProperty, PowerUI.Css.BackgroundColour, and PowerUI.Css.RoundBorderInverseProperty.

void PowerUI.Css.DisplayableProperty.Render ( )
inline

Make this property visible by forcing it to redraw.

void PowerUI.Css.DisplayableProperty.RequestLayout ( )
inline

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.

void PowerUI.Css.DisplayableProperty.RequestPaint ( )
inline

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.

AtlasLocation PowerUI.Css.DisplayableProperty.RequireImage ( AtlasEntity  image)
inline
void PowerUI.Css.DisplayableProperty.SetOverlayColour ( )
inline

Sets the overlay colour from the elements colour overlay property.

virtual void PowerUI.Css.DisplayableProperty.SetOverlayColour ( Color  colour)
inlinevirtual

Called to apply the given colour overlay to this property.

Parameters
colourThe colour overlay to apply.

Reimplemented in PowerUI.Css.TextRenderingProperty, PowerUI.Css.BorderProperty, PowerUI.Css.BackgroundImage, PowerUI.Css.BackgroundColour, and PowerUI.Css.RoundBorderInverseProperty.

void PowerUI.Css.DisplayableProperty.SetupBatch ( TextureAtlas  graphics,
TextureAtlas  font 
)
inline
void PowerUI.Css.DisplayableProperty.SetVisibility ( bool  visible)
inline

Call this when the visibility of this property as a whole changes.

void PowerUI.Css.DisplayableProperty.Transform ( Transformation  topTransform)
inline

Transforms all the blocks that this property has allocated. Note that transformations are a post process.

Parameters
topTransformThe transform that should be applied to this property.
void PowerUI.Css.DisplayableProperty.WentOffScreen ( )
inline

Member Data Documentation

int PowerUI.Css.DisplayableProperty.BlockCount

The number of mesh blocks that this property has allocated.

bool PowerUI.Css.DisplayableProperty.Changed

True if this property has changed its appearance.

Element PowerUI.Css.DisplayableProperty.Element

The parent element that this is a property of.

MeshBlock PowerUI.Css.DisplayableProperty.FirstBlock

The first mesh block that this property has allocated. This is the head of a linked list.

bool PowerUI.Css.DisplayableProperty.GotBatchAlready

Only applies to Isolated properties. Set to true when this property has allocated a UIBatch on the current layout.

bool PowerUI.Css.DisplayableProperty.Isolated

True if this property is isolated and has a seperate mesh and material from everything else.

bool PowerUI.Css.DisplayableProperty.Visible

True if this is currently visible on screen.

Property Documentation

bool PowerUI.Css.DisplayableProperty.Paintable
get

Checks if this property can be repainted.

Returns
True if this property has blocks allocated as they can be repainted; false otherwise.