C# Class Axiom.Overlays.OverlayElement

Abstract definition of a 2D element to be displayed in an Overlay.
This class abstracts all the details of a 2D element which will appear in an overlay. In fact, not all OverlayElement instances can be directly added to an Overlay, only those which are OverlayElementContainer instances (derived from this class) are able to be added, however they can contain any OverlayElement however. This is done to enforce some level of grouping of widgets.
OverlayElements should be managed using OverlayElementManager. This class is responsible for instantiating / deleting elements, and also for accepting new types of element from plugins etc.
Note that positions / dimensions of 2D screen elements are expressed as parametric values (0.0 - 1.0) because this makes them resolution-independent. However, most screen resolutions have an aspect ratio of 1.3333:1 (width : height) so note that in physical pixels 0.5 is wider than it is tall, so a 0.5x0.5 panel will not be square on the screen (but it will take up exactly half the screen in both dimensions).
Inheritance: IRenderable
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Свойство Type Description
clippingRegion Axiom.Core.Rectangle
color Axiom.Core.ColorEx
customParams List
derivedLeft float
emptyLightList LightList
horzAlign HorizontalAlignment
isCloneable bool
isDerivedOutOfDate bool
isEnabled bool
isGeomPositionsOutOfDate bool
isGeomUVsOutOfDate bool
isInitialized bool
isVisible bool
left float
material Axiom.Graphics.Material
materialName string
metricsMode MetricsMode
name string
overlay Overlay
parent OverlayElementContainer
pixelHeight float
pixelLeft float
pixelScaleX float
pixelScaleY float
pixelTop float
pixelWidth float
renderOperation Axiom.Graphics.RenderOperation
sourceTemplate OverlayElement
text string
vertAlign VerticalAlignment
xform Axiom.MathLib.Matrix4[]
zOrder int

Méthodes publiques

Méthode Description
Clone ( string instanceName ) : OverlayElement
Contains ( float x, float y ) : bool

Returns true if xy is within the constraints of the component

CopyFromTemplate ( OverlayElement template ) : void

Copys data from the template element to this element to clone it.

CopyParametersTo ( OverlayElement instance ) : void
FindElementAt ( float x, float y ) : OverlayElement

Returns true if xy is within the constraints of the component

GetCustomParameter ( int index ) : Vector4
GetSquaredViewDepth ( Camera camera ) : float

Implementation of IRenderable.

GetWorldOrientation ( ) : Axiom.MathLib.Quaternion

GetWorldPosition ( ) : Vector3
GetWorldTransforms ( Axiom.MathLib.Matrix4 matrices ) : void

Hide ( ) : void

Hides an element if it is currently visible.

Initialize ( ) : void

Initialize the OverlayElement.

NotifyParent ( OverlayElementContainer parent, Overlay overlay ) : void

Internal method for notifying the gui element of it's parent and ultimate overlay.

NotifyViewport ( ) : void

Notifies the viewport.

NotifyWorldTransforms ( Axiom.MathLib.Matrix4 xform ) : void

Notifies the world transforms.

NotifyZOrder ( int zOrder ) : int

Internal method to notify the element when Zorder of parent overlay has changed.

Overlays have explicit Z orders. OverlayElements do not, they inherit the ZOrder of the overlay, and the Zorder is incremented for every container nested within this to ensure that containers are displayed behind contained items. This method is used internally to notify the element of a change in final zorder which is used to render the element.

PositionsOutOfDate ( ) : void

Tells this element to recaculate it's position.

ScreenDimensions ( float width, float height ) : void

Sets the width and height of this element in relation to the screen (where 1.0 = screen width)

ScreenHeight ( float height ) : void

Sets the height of this element in relation to the screen (where 1.0 = screen width)

ScreenLeft ( float left ) : void

Sets the left of this element in relation to the screen (where 1.0 = screen width)

ScreenPosition ( float left, float top ) : void

Sets the left and top of this element in relation to the screen (where 1.0 = screen width)

ScreenTop ( float top ) : void

Sets the top of this element in relation to the screen (where 1.0 = screen width)

ScreenWidth ( float width ) : void

Sets the width of this element in relation to the screen (where 1.0 = screen width)

SetCustomParameter ( int index, Vector4 val ) : void
SetDimensions ( float width, float height ) : void

Sets the dimensions.

SetParam ( string param, string val ) : bool

Sets param values from script values. Subclasses can define their own params in addition to what this base class already defines.

SetPosition ( float left, float top ) : void

Sets the position of this element.

Show ( ) : void

Shows this element if it was previously hidden.

Update ( ) : void

Internal method to update the element based on transforms applied.

UpdateCustomGpuParameter ( GpuProgramParameters entry, GpuProgramParameters gpuParams ) : void
UpdateFromParent ( ) : void

Updates this elements transform based on it's parent.

UpdateRenderQueue ( RenderQueue queue ) : void

Internal method to put the contents onto the render queue.

Méthodes protégées

Méthode Description
OverlayElement ( string name ) : System

UpdatePositionGeometry ( ) : void

Internal method which is triggered when the positions of the element get updated, meaning the element should be rebuilding it's mesh positions. Abstract since subclasses must implement this.

UpdateTextureGeometry ( ) : void

Internal method which is triggered when the UVs of the element get updated, meaning the element should be rebuilding it's mesh UVs. Abstract since subclasses must implement this.

dispose ( bool disposeManagedResources ) : void

Class level dispose method

When implementing this method in an inherited class the following template should be used; protected override void dispose( bool disposeManagedResources ) { if ( !isDisposed ) { if ( disposeManagedResources ) { // Dispose managed resources. } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); }

Method Details

Clone() public méthode

public Clone ( string instanceName ) : OverlayElement
instanceName string
Résultat OverlayElement

Contains() public méthode

Returns true if xy is within the constraints of the component
public Contains ( float x, float y ) : bool
x float
y float
Résultat bool

CopyFromTemplate() public méthode

Copys data from the template element to this element to clone it.
public CopyFromTemplate ( OverlayElement template ) : void
template OverlayElement
Résultat void

CopyParametersTo() public méthode

public CopyParametersTo ( OverlayElement instance ) : void
instance OverlayElement
Résultat void

FindElementAt() public méthode

Returns true if xy is within the constraints of the component
public FindElementAt ( float x, float y ) : OverlayElement
x float The x.
y float The y.
Résultat OverlayElement

GetCustomParameter() public méthode

public GetCustomParameter ( int index ) : Vector4
index int
Résultat Vector4

GetSquaredViewDepth() public méthode

Implementation of IRenderable.
public GetSquaredViewDepth ( Camera camera ) : float
camera Axiom.Core.Camera
Résultat float

GetWorldOrientation() public méthode

public GetWorldOrientation ( ) : Axiom.MathLib.Quaternion
Résultat Axiom.MathLib.Quaternion

GetWorldPosition() public méthode

public GetWorldPosition ( ) : Vector3
Résultat Vector3

GetWorldTransforms() public méthode

public GetWorldTransforms ( Axiom.MathLib.Matrix4 matrices ) : void
matrices Axiom.MathLib.Matrix4
Résultat void

Hide() public méthode

Hides an element if it is currently visible.
public Hide ( ) : void
Résultat void

Initialize() public abstract méthode

Initialize the OverlayElement.
public abstract Initialize ( ) : void
Résultat void

NotifyParent() public méthode

Internal method for notifying the gui element of it's parent and ultimate overlay.
public NotifyParent ( OverlayElementContainer parent, Overlay overlay ) : void
parent OverlayElementContainer Parent of this element.
overlay Overlay Overlay this element belongs to.
Résultat void

NotifyViewport() public méthode

Notifies the viewport.
public NotifyViewport ( ) : void
Résultat void

NotifyWorldTransforms() public méthode

Notifies the world transforms.
public NotifyWorldTransforms ( Axiom.MathLib.Matrix4 xform ) : void
xform Axiom.MathLib.Matrix4 The xform.
Résultat void

NotifyZOrder() public méthode

Internal method to notify the element when Zorder of parent overlay has changed.
Overlays have explicit Z orders. OverlayElements do not, they inherit the ZOrder of the overlay, and the Zorder is incremented for every container nested within this to ensure that containers are displayed behind contained items. This method is used internally to notify the element of a change in final zorder which is used to render the element.
public NotifyZOrder ( int zOrder ) : int
zOrder int The z order.
Résultat int

OverlayElement() protected méthode

protected OverlayElement ( string name ) : System
name string
Résultat System

PositionsOutOfDate() public méthode

Tells this element to recaculate it's position.
public PositionsOutOfDate ( ) : void
Résultat void

ScreenDimensions() public méthode

Sets the width and height of this element in relation to the screen (where 1.0 = screen width)
public ScreenDimensions ( float width, float height ) : void
width float
height float
Résultat void

ScreenHeight() public méthode

Sets the height of this element in relation to the screen (where 1.0 = screen width)
public ScreenHeight ( float height ) : void
height float
Résultat void

ScreenLeft() public méthode

Sets the left of this element in relation to the screen (where 1.0 = screen width)
public ScreenLeft ( float left ) : void
left float
Résultat void

ScreenPosition() public méthode

Sets the left and top of this element in relation to the screen (where 1.0 = screen width)
public ScreenPosition ( float left, float top ) : void
left float
top float
Résultat void

ScreenTop() public méthode

Sets the top of this element in relation to the screen (where 1.0 = screen width)
public ScreenTop ( float top ) : void
top float
Résultat void

ScreenWidth() public méthode

Sets the width of this element in relation to the screen (where 1.0 = screen width)
public ScreenWidth ( float width ) : void
width float
Résultat void

SetCustomParameter() public méthode

public SetCustomParameter ( int index, Vector4 val ) : void
index int
val Vector4
Résultat void

SetDimensions() public méthode

Sets the dimensions.
public SetDimensions ( float width, float height ) : void
width float The width.
height float The height.
Résultat void

SetParam() public méthode

Sets param values from script values. Subclasses can define their own params in addition to what this base class already defines.
public SetParam ( string param, string val ) : bool
param string
val string
Résultat bool

SetPosition() public méthode

Sets the position of this element.
public SetPosition ( float left, float top ) : void
left float The left.
top float The top.
Résultat void

Show() public méthode

Shows this element if it was previously hidden.
public Show ( ) : void
Résultat void

Update() public méthode

Internal method to update the element based on transforms applied.
public Update ( ) : void
Résultat void

UpdateCustomGpuParameter() public méthode

public UpdateCustomGpuParameter ( GpuProgramParameters entry, GpuProgramParameters gpuParams ) : void
entry Axiom.Graphics.GpuProgramParameters
gpuParams Axiom.Graphics.GpuProgramParameters
Résultat void

UpdateFromParent() public méthode

Updates this elements transform based on it's parent.
public UpdateFromParent ( ) : void
Résultat void

UpdatePositionGeometry() protected abstract méthode

Internal method which is triggered when the positions of the element get updated, meaning the element should be rebuilding it's mesh positions. Abstract since subclasses must implement this.
protected abstract UpdatePositionGeometry ( ) : void
Résultat void

UpdateRenderQueue() public méthode

Internal method to put the contents onto the render queue.
public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue Current render queue.
Résultat void

UpdateTextureGeometry() protected abstract méthode

Internal method which is triggered when the UVs of the element get updated, meaning the element should be rebuilding it's mesh UVs. Abstract since subclasses must implement this.
protected abstract UpdateTextureGeometry ( ) : void
Résultat void

dispose() protected méthode

Class level dispose method
When implementing this method in an inherited class the following template should be used; protected override void dispose( bool disposeManagedResources ) { if ( !isDisposed ) { if ( disposeManagedResources ) { // Dispose managed resources. } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); }
protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool True if Unmanaged resources should be released.
Résultat void

Property Details

clippingRegion protected_oe property

protected Rectangle,Axiom.Core clippingRegion
Résultat Axiom.Core.Rectangle

color protected_oe property

protected ColorEx,Axiom.Core color
Résultat Axiom.Core.ColorEx

customParams protected_oe property

protected List customParams
Résultat List

derivedLeft protected_oe property

protected float derivedLeft
Résultat float

emptyLightList protected_oe property

protected LightList emptyLightList
Résultat LightList

horzAlign protected_oe property

protected HorizontalAlignment horzAlign
Résultat HorizontalAlignment

isCloneable protected_oe property

protected bool isCloneable
Résultat bool

isDerivedOutOfDate protected_oe property

protected bool isDerivedOutOfDate
Résultat bool

isEnabled protected_oe property

protected bool isEnabled
Résultat bool

isGeomPositionsOutOfDate protected_oe property

protected bool isGeomPositionsOutOfDate
Résultat bool

isGeomUVsOutOfDate protected_oe property

protected bool isGeomUVsOutOfDate
Résultat bool

isInitialized protected_oe property

protected bool isInitialized
Résultat bool

isVisible protected_oe property

protected bool isVisible
Résultat bool

left protected_oe property

protected float left
Résultat float

material protected_oe property

protected Material,Axiom.Graphics material
Résultat Axiom.Graphics.Material

materialName protected_oe property

protected string materialName
Résultat string

metricsMode protected_oe property

protected MetricsMode metricsMode
Résultat MetricsMode

name protected_oe property

protected string name
Résultat string

overlay protected_oe property

protected Overlay,Axiom.Overlays overlay
Résultat Overlay

parent protected_oe property

protected OverlayElementContainer,Axiom.Overlays parent
Résultat OverlayElementContainer

pixelHeight protected_oe property

protected float pixelHeight
Résultat float

pixelLeft protected_oe property

protected float pixelLeft
Résultat float

pixelScaleX protected_oe property

protected float pixelScaleX
Résultat float

pixelScaleY protected_oe property

protected float pixelScaleY
Résultat float

pixelTop protected_oe property

protected float pixelTop
Résultat float

pixelWidth protected_oe property

protected float pixelWidth
Résultat float

renderOperation protected_oe property

protected RenderOperation,Axiom.Graphics renderOperation
Résultat Axiom.Graphics.RenderOperation

sourceTemplate protected_oe property

protected OverlayElement,Axiom.Overlays sourceTemplate
Résultat OverlayElement

text protected_oe property

protected string text
Résultat string

vertAlign protected_oe property

protected VerticalAlignment vertAlign
Résultat VerticalAlignment

xform protected_oe property

protected Matrix4[],Axiom.MathLib xform
Résultat Axiom.MathLib.Matrix4[]

zOrder protected_oe property

protected int zOrder
Résultat int