Hi. I have a 3D Scene on the whole screen. Now I wanna add a small GUI (a HUD). If I do so, parts of the scene aren't visible. So the view area of the 3D scene is smaller. What I wanna do now is to fit the whole 3D scene to the smaller area so that the HUD isn't just in front of the scene.
This is how it looks like now:
This it should looks like:
The red border shows how large the size of the 3D scene is.
I tried setViewPort. The problem is, that the GUI is also drawn with thie view port, so it also will be displayed smaller and this isn't what I want.
Thank for help.
Ingame GUI -> smaller View
-
- Posts: 299
- Joined: Mon Nov 27, 2006 6:52 pm
- Location: GERMANY
- Contact:
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
Hey bersi
The reason your GUI is drawn in the viewport is cos you are drawing it there.
Take a look at this example :
This will leave your GUI alone and draw it OVER the scene as well as
having the extra sace on the side to draw it.
I cant really code it exactly for you, but here is a cpp example
The reason your GUI is drawn in the viewport is cos you are drawing it there.
Take a look at this example :
Code: Select all
setViewport(my scene size)
draw my scene
setViewport(fullscreen size)
draw my GUI
having the extra sace on the side to draw it.
I cant really code it exactly for you, but here is a cpp example
Code: Select all
device->beginscene(..);
smgr->setViewport(0,0,widthOfViewPort,heightOfViewPort);
smgr->drawAll();
smgr->setViewport(0,0,screenX,screenY);
guienv->drawAll();