I want to know if there are any method to achieve this.
As I am making a game which I plan to have half of the screen in a 3D world with some characters, and another half of the screen covered by an 2D image. Furthermore, there are one character appearing on (above) the 2D image.
What I am now making is to make the 2D image into an IGUIImage, but I don't know if there are ways that I can put my character(animated scene node) above the IGUIImage?
Can any one tell me what I should do with it, or any suggestion that I can have the same effect?
To set a scene node above one 2D GUI element
If I'm understanding you correctly, you are trying to create a window that has a background and then shows a mesh in the foreground. Irrlicht has the IGUIMeshViewer that you should be able to use. A while back the mesh viewer element didn't work, so I wrote CGUIViewport that you could use to render an entire scene inside a gui element.
scene and gui are rendered in order you specify. This for example will render scene first than gui (means gui elements will always be rendered on top of scene elements):
If you wan, you can render it in opposite order.
If you however want to draw just one specific gui element before all else, you have to draw it manually yourself. Unfortunately there is no way you can create CGUIImage so you have to draw image yourself. Something like this should work:
Code: Select all
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}If you however want to draw just one specific gui element before all else, you have to draw it manually yourself. Unfortunately there is no way you can create CGUIImage so you have to draw image yourself. Something like this should work:
Code: Select all
video::ITexture *image = driver->getTexture("free.bmp");
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
driver->draw2DImage(image, core::position2d<s32>(50,50));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}