## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

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.

    // how to add a 2D overlay with text
    var overlay = new CL3D.Overlay2DSceneNode();
    scene.getRootSceneNode().addChild(overlay);

    overlay.set2DPosition(10,10,200,70);
    overlay.setText('Hello World!');
    overlay.FontName = "12;default;arial;normal;bold;true";
    overlay.TextColor = CL3D.createColor(255, 150, 232, 249);

Parameters:
engine

Field Summary
Field Attributes | Field Name and Description
--- | ---
| FontName Font string to be used when drawing text.
| TextAlignment Text alignment to be used.
| TextColor Text color to be used.

Fields borrowed from class CL3D.SceneNode:
  Id, Name, Pos, Rot, Scale, Selector, Visible

Method Summary
Method Attributes | Method Name and Description
--- | ---
| getBoundingBox() 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, isActuallyVisible, OnAnimate, OnRegisterSceneNode, removeAnimator, removeChild, render, updateAbsolutePosition

Field Detail
{String.} FontName
Font string to be used when drawing text. It uses the following format: PointSize;Family(Default|Decorative|Roman|Script|Swiss|Modern);FaceName(Arial etc);Style(Normal|Slant|Italic);Weight(Normal|Light|Bold);Underlined(True|false) Example: "12;default;arial;normal;bold;true"

Default Value:
  ""

{Number} TextAlignment
Text alignment to be used. Use 0 for left align, 1 for center and 2 for multiline with word wrap.

Default Value:
  0

{Number} TextColor
Text color to be used. Use for example CL3D.createColor(255, 150, 232, 249); to create a nice color.

Default Value:
  0

Method Detail
{CL3D.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:
  {CL3D.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:
{CL3D.Texture} tex
  a CL3D.Texture to show as image on the 2d overlay

setText(text)
Sets the text which should be shown on the overlay 2D node. Note that you can also set a text color using the .TextColor property and a font using the FontName property.

Parameters:
text
  {String}

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit