Mini-map in MyGUI


20-09-2008 15:31:55

Hi all,

I'm in a need of creating a mini-map for my game. I found this interesting article on the web about creating a mini-map using CEGUI in Ogre (, but I am not sure how to "translate" it into MyGUI. I guess MyGUI allows for the creation of mini-maps... or not?

Could someone help me out here? Thanks a lot!


20-09-2008 16:13:08

You should use RenderBox widget for it. Code is almost same, but you don't need to create texture manually and last (GUI related) part is only one line :)
MyGUI::RenderBoxPtr minimap = MyGUI::Gui::getInstance().createWidget<MyGUI::RenderBox>("RenderBox", IntCoord(50, 50, 300, 300), Align::Default, "Main");

Ogre::Radian fieldOfView = _camera->getFOVy();
float height = _sceneLength/2 / Ogre::Math::Sin(fieldOfView / 2);

Vector3 cameraPosition = Vector3(_sceneLength/2,_sceneWidth/2, height);
Vector3 lookAt = Vector3(_sceneLength/2,_sceneWidth/2, 0);

//create a minimap camera, use the same settings as main camera
_= _sceneManager->createCamera("minimapCamera");
//AspectRatio(1) is for a square minimap



20-09-2008 16:16:48

Cool! Thanks a lot, I'll check it out :)


20-09-2008 22:48:42

It doesn't seem to work if I put it that way. The map keeps reproducing itself recursively...