Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Is there a way to get the world size of a object, both a Overlay2DSceneNode (width and height) object and a 3D object (x, y, z)? You can set the width and height for a Overlay2DSceneNode object, but you cant get it from the object. |
||||
|
You get the size of any object in 3D by querying it's bounding box. Use getBoundingBox() of any scene node, or getTransformedBoundingBox() if you prefer the bounding box in global space. For the Overlay 2D node: You can use the not-documented function getScreenCoordinatesRect() for this, it takes a bool and the renderer as parameter. Use it for example like this: getScreenCoordinatesRect(false, engine.getRenderer()); |
||||
|
Nice, thanks niko! |
||||
|
Hi, I'm trying to create a simple demo where with 4 buttons (2D Overlay ditto) up, down, left, right respectively can go forward, backward, turn left, turn right. I saw the 2D Overlay idem but I can not understand what actions should I use. Who can help me? Thank you very much |
|