C# Класс Axiom.Overlays.Overlay

Represents a layer which is rendered on top of the 'normal' scene contents.
An overlay is a container for visual components (2D and 3D) which will be rendered after the main scene in order to composite heads-up-displays, menus or other layers on top of the contents of the scene.

An overlay always takes up the entire size of the viewport, although the components attached to it do not have to. An overlay has no visual element in itself, it it merely a container for visual elements.

Overlays are created by calling SceneManager.CreateOverlay, or by defining them in special text scripts (.overlay files). As many overlays as you like can be defined; after creation an overlay is hidden i.e. not visible until you specifically enable it by calling Show(). This allows you to have multiple overlays predefined (menus etc) which you make visible only when you want. It is possible to have multiple overlays enabled at once; in this case the relative ZOrder parameter of the overlays determine which one is displayed on top.

By default overlays are rendered into all viewports. This is fine when you only have fullscreen viewports, but if you have picture-in-picture views, you probably don't want the overlay displayed in the smaller viewports. You turn this off for a specific viewport by calling the Viewport.DisplayOverlays property.

Наследование: Axiom.Core.Resource
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
elementList List
elementLookup OverlayElementContainer>.Dictionary
isInitialised bool
isTransformOutOfDate bool
isTransformUpdated bool
isVisible bool
origin string
rootNode Axiom.Core.SceneNode
rotate float
scaleX float
scrollX float
transform Axiom.Math.Matrix4
xform Axiom.Math.Matrix4[]
zOrder int

Открытые методы

Метод Описание
AddElement ( OverlayElementContainer element ) : void

Adds a 2d element to this overlay.

Containers are created and managed using the OverlayManager. A container could be as simple as a square panel, or something more complex like a grid or tree view. Containers group collections of other elements, giving them a relative coordinate space and a common z-order. If you want to attach a gui widget to an overlay, you have to do it via a container.

AddElement ( SceneNode node ) : void

Adds a node capable of holding 3D objects to the overlay.

Although overlays are traditionally associated with 2D elements, there are reasons why you might want to attach 3D elements to the overlay too. For example, if you wanted to have a 3D cockpit, which was overlaid with a HUD, then you would create 2 overlays, one with a 3D object attached for the cockpit, and one with the HUD elements attached (the zorder of the HUD overlay would be higher than the cockpit to ensure it was always on top).

A SceneNode can have any number of 3D objects attached to it. SceneNodes are created using SceneManager.CreateSceneNode, and are normally attached (directly or indirectly) to the root node of the scene. By attaching them to an overlay, you indicate that:

  1. You want the contents of this node to only appear when the overlay is active
  2. You want the node to inherit a coordinate space relative to the camera, rather than relative to the root scene node
  3. You want these objects to be rendered after the contents of the main scene to ensure they are rendered on top
One major consideration when using 3D objects in overlays is the behavior of the depth buffer. Overlays are rendered with depth checking off, to ensure that their contents are always displayed on top of the main scene (to do otherwise would result in objects 'poking through' the overlay). The problem with using 3D objects is that if they are concave, or self-overlap, then you can get artifacts because of the lack of depth buffer checking. So you should ensure that any 3D objects you us in the overlay are convex and don't overlap each other. If they must overlap, split them up and put them in 2 overlays.
Clear ( ) : void

Clears the overlay of all attached items.

FindElementAt ( float x, float y ) : OverlayElement

This returns a OverlayElement at position x,y.

FindVisibleObjects ( Camera camera, RenderQueue queue ) : void

Internal method to put the overlay contents onto the render queue.

GetChild ( string name ) : OverlayElementContainer

Gets a child container of this overlay by name.

GetWorldOrientation ( ) : Quaternion
GetWorldPosition ( ) : Vector3
GetWorldTransforms ( Matrix4 xform ) : void

Used to transform the overlay when scrolling, scaling etc.

Hide ( ) : void

Hides this overlay if it is currently being displayed.

RemoveElement ( OverlayElementContainer element ) : void

Removes a 2D container from the overlay.

Consider using Hide.

RemoveElement ( SceneNode node ) : void

Removes a 3D element from the overlay.

RemoveElement ( string name ) : void

Removes a 2D container from the overlay.

Consider using Hide.

Rotate ( float degrees ) : void

Adds the passed in angle to the rotation applied to this overlay.

Scroll ( float xOffset, float yOffset ) : void

Scrolls the overlay by the offsets provided.

This method moves the overlay by the amounts provided. As with other methods on this object, a full screen width / height is represented by the value 1.0.

SetScale ( float x, float y ) : void

Sets the scaling factor of this overlay.

You can use this to set an scale factor to be used to zoom an overlay.

SetScroll ( float x, float y ) : void

Sets the scrolling factor of this overlay.

You can use this to set an offset to be used to scroll an overlay around the screen.

Show ( ) : void

Shows this overlay if it is not already visible.

Защищенные методы

Метод Описание
AssignZOrders ( ) : void

Updates container elements' Z-ordering

Initialize ( ) : void
UpdateTransforms ( ) : void

Internal lazy update method.

load ( ) : void

unload ( ) : void

Приватные методы

Метод Описание
Overlay ( string name ) : System

Constructor: do not call direct, use SceneManager.CreateOverlay

Описание методов

AddElement() публичный Метод

Adds a 2d element to this overlay.
Containers are created and managed using the OverlayManager. A container could be as simple as a square panel, or something more complex like a grid or tree view. Containers group collections of other elements, giving them a relative coordinate space and a common z-order. If you want to attach a gui widget to an overlay, you have to do it via a container.
public AddElement ( OverlayElementContainer element ) : void
element OverlayElementContainer
Результат void

AddElement() публичный Метод

Adds a node capable of holding 3D objects to the overlay.
Although overlays are traditionally associated with 2D elements, there are reasons why you might want to attach 3D elements to the overlay too. For example, if you wanted to have a 3D cockpit, which was overlaid with a HUD, then you would create 2 overlays, one with a 3D object attached for the cockpit, and one with the HUD elements attached (the zorder of the HUD overlay would be higher than the cockpit to ensure it was always on top).

A SceneNode can have any number of 3D objects attached to it. SceneNodes are created using SceneManager.CreateSceneNode, and are normally attached (directly or indirectly) to the root node of the scene. By attaching them to an overlay, you indicate that:

  1. You want the contents of this node to only appear when the overlay is active
  2. You want the node to inherit a coordinate space relative to the camera, rather than relative to the root scene node
  3. You want these objects to be rendered after the contents of the main scene to ensure they are rendered on top
One major consideration when using 3D objects in overlays is the behavior of the depth buffer. Overlays are rendered with depth checking off, to ensure that their contents are always displayed on top of the main scene (to do otherwise would result in objects 'poking through' the overlay). The problem with using 3D objects is that if they are concave, or self-overlap, then you can get artifacts because of the lack of depth buffer checking. So you should ensure that any 3D objects you us in the overlay are convex and don't overlap each other. If they must overlap, split them up and put them in 2 overlays.
public AddElement ( SceneNode node ) : void
node Axiom.Core.SceneNode
Результат void

AssignZOrders() защищенный Метод

Updates container elements' Z-ordering
protected AssignZOrders ( ) : void
Результат void

Clear() публичный Метод

Clears the overlay of all attached items.
public Clear ( ) : void
Результат void

FindElementAt() публичный Метод

This returns a OverlayElement at position x,y.
public FindElementAt ( float x, float y ) : OverlayElement
x float
y float
Результат OverlayElement

FindVisibleObjects() публичный Метод

Internal method to put the overlay contents onto the render queue.
public FindVisibleObjects ( Camera camera, RenderQueue queue ) : void
camera Axiom.Core.Camera Current camera being used in the render loop.
queue Axiom.Graphics.RenderQueue Current render queue.
Результат void

GetChild() публичный Метод

Gets a child container of this overlay by name.
public GetChild ( string name ) : OverlayElementContainer
name string
Результат OverlayElementContainer

GetWorldOrientation() публичный Метод

public GetWorldOrientation ( ) : Quaternion
Результат Axiom.Math.Quaternion

GetWorldPosition() публичный Метод

public GetWorldPosition ( ) : Vector3
Результат Vector3

GetWorldTransforms() публичный Метод

Used to transform the overlay when scrolling, scaling etc.
public GetWorldTransforms ( Matrix4 xform ) : void
xform Axiom.Math.Matrix4 Array of Matrix4s to populate with the world /// transforms of this overlay. ///
Результат void

Hide() публичный Метод

Hides this overlay if it is currently being displayed.
public Hide ( ) : void
Результат void

Initialize() защищенный Метод

protected Initialize ( ) : void
Результат void

RemoveElement() публичный Метод

Removes a 2D container from the overlay.
Consider using Hide.
public RemoveElement ( OverlayElementContainer element ) : void
element OverlayElementContainer
Результат void

RemoveElement() публичный Метод

Removes a 3D element from the overlay.
public RemoveElement ( SceneNode node ) : void
node Axiom.Core.SceneNode
Результат void

RemoveElement() публичный Метод

Removes a 2D container from the overlay.
Consider using Hide.
public RemoveElement ( string name ) : void
name string
Результат void

Rotate() публичный Метод

Adds the passed in angle to the rotation applied to this overlay.
public Rotate ( float degrees ) : void
degrees float
Результат void

Scroll() публичный Метод

Scrolls the overlay by the offsets provided.
This method moves the overlay by the amounts provided. As with other methods on this object, a full screen width / height is represented by the value 1.0.
public Scroll ( float xOffset, float yOffset ) : void
xOffset float
yOffset float
Результат void

SetScale() публичный Метод

Sets the scaling factor of this overlay.
You can use this to set an scale factor to be used to zoom an overlay.
public SetScale ( float x, float y ) : void
x float Horizontal scale value, where 1.0 = normal, 0.5 = half size etc
y float Vertical scale value, where 1.0 = normal, 0.5 = half size etc
Результат void

SetScroll() публичный Метод

Sets the scrolling factor of this overlay.
You can use this to set an offset to be used to scroll an overlay around the screen.
public SetScroll ( float x, float y ) : void
x float /// Horizontal scroll value, where 0 = normal, -0.5 = scroll so that only /// the right half the screen is visible etc ///
y float /// Vertical scroll value, where 0 = normal, 0.5 = scroll down by half /// a screen etc. ///
Результат void

Show() публичный Метод

Shows this overlay if it is not already visible.
public Show ( ) : void
Результат void

UpdateTransforms() защищенный Метод

Internal lazy update method.
protected UpdateTransforms ( ) : void
Результат void

load() защищенный Метод

protected load ( ) : void
Результат void

unload() защищенный Метод

protected unload ( ) : void
Результат void

Описание свойств

elementList защищенное свойство

2D element list.
protected List elementList
Результат List

elementLookup защищенное свойство

protected Dictionary elementLookup
Результат OverlayElementContainer>.Dictionary

isInitialised защищенное свойство

protected bool isInitialised
Результат bool

isTransformOutOfDate защищенное свойство

protected bool isTransformOutOfDate
Результат bool

isTransformUpdated защищенное свойство

protected bool isTransformUpdated
Результат bool

isVisible защищенное свойство

protected bool isVisible
Результат bool

origin защищенное свойство

protected string origin
Результат string

rootNode защищенное свойство

Internal root node, used as parent for 3D objects
protected SceneNode,Axiom.Core rootNode
Результат Axiom.Core.SceneNode

rotate защищенное свойство

Degrees of rotation around center.
protected float rotate
Результат float

scaleX защищенное свойство

Scale values.
protected float scaleX
Результат float

scrollX защищенное свойство

Scroll values, offsets.
protected float scrollX
Результат float

transform защищенное свойство

Camera relative transform.
protected Matrix4,Axiom.Math transform
Результат Axiom.Math.Matrix4

xform защищенное свойство

Used when passing transform to overlay elements.
protected Matrix4[],Axiom.Math xform
Результат Axiom.Math.Matrix4[]

zOrder защищенное свойство

protected int zOrder
Результат int