CopperLicht API Documentation
Class CL3D.Overlay2DSceneNode
Scene Node which draws a 2d overlay with color, image and/or text
Extends
CL3D.SceneNode.
Class Overview
CL3D.Overlay2DSceneNode(engine)
A simple 2d overlay scene node which draws a 2d area over the 3d scene. Useful for displaying text, images and similar.
- Parameters:
- engine
Method Attributes | Method Name and Description |
---|---|
Get the axis aligned, not transformed bounding box of this node.
|
|
getType()
Returns the type string of the scene node.
|
|
set2DPosition(x, y, width, height)
Sets the position of the overlay in pixels
|
|
setShowBackgroundColor(showBackground, color)
Sets if the overlay scene node should show a colored background
|
|
setShowImage(tex)
Sets if the overlay scene node should show a image
|
|
setText(text)
Sets the text which should be shown on the overlay 2D node
|
- Methods borrowed from class CL3D.SceneNode:
- addAnimator, addChild, createClone, getAbsolutePosition, getAbsoluteTransformation, getAnimatorOfType, getAnimators, getChildren, getMaterial, getMaterialCount, getParent, getRelativeTransformation, getTransformedBoundingBox, init, OnAnimate, OnRegisterSceneNode, removeAnimator, removeChild, render, updateAbsolutePosition
Method Detail
{Box3D}
getBoundingBox()
Get the axis aligned, not transformed bounding box of this node.
This means that if this node is an animated 3d character, moving in a room, the bounding box will
always be around the origin. To get the box in real world coordinates, just transform it with the matrix
you receive with getAbsoluteTransformation() or simply use getTransformedBoundingBox(), which does the same.
- Returns:
- {Box3D} Bounding box of this scene node.
{String}
getType()
Returns the type string of the scene node.
Returns '2doverlay' for the scene node.
- Returns:
- {String} type name of the scene node.
set2DPosition(x, y, width, height)
Sets the position of the overlay in pixels
- Parameters:
- x
- {Number} x position of the overlay in pixels
- y
- {Number} y position of the overlay in pixels
- width
- {Number} width of the overlay in pixels
- height
- {Number} height of the overlay in pixels
setShowBackgroundColor(showBackground, color)
Sets if the overlay scene node should show a colored background
- Parameters:
- showBackground
- {Boolean} true to show the backgroundcolor, false if not
- color
- {Number} a color created with CL3D.createColor defining the color to show
setShowImage(tex)
Sets if the overlay scene node should show a image
- Parameters:
- tex
- {Texture} a Texture to show as image on the 2d overlay
setText(text)
Sets the text which should be shown on the overlay 2D node
- Parameters:
- text
- {String}