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
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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