how can I show my ceguilayout and the ogre overlay at the sa

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
jasom_liu
Just popping in
Just popping in
Posts: 14
Joined: Mon Mar 07, 2005 08:00

how can I show my ceguilayout and the ogre overlay at the sa

Postby jasom_liu » Thu Apr 14, 2005 10:01

I want to show a bmp graphic as the background and a cegui layout as the UI in ogre,but i failed. it's only show the ogre overlay ,where is my ceguilayout and my mouse?? :( my createScene function is shown below:
i think maybe i create the overlay in a wrong place.
How can i do it ? Thanks very much.


void createScene(void)
{

//My Ogre Overlay
Overlay *lay = OverlayManager::getSingleton().create ("background");
OverlayContainer* cont = (OverlayContainer*)OverlayManager::getSingleton().createOverlayElement("Panel", "Login");
MaterialPtr pMat = MaterialManager::getSingleton().create( "TextMat",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
pMat->getTechnique(0)->getPass(0)->createTextureUnitState( "Login.BMP" );
cont->setMaterialName("TextMat");
lay->setZOrder(500);
lay->add2D(cont);
lay->show();

// setup GUI system
mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000);

mGUISystem = new CEGUI::System(mGUIRenderer);
// load scheme and set up defaults
CEGUI::SchemeManager::getSingleton().loadScheme(
(CEGUI::utf8*)"WindowsLook.scheme");
mGUISystem->setDefaultMouseCursor(
(CEGUI::utf8*)"WindowsLook", (CEGUI::utf8*)"MouseArrow");
mGUISystem->setDefaultFont((CEGUI::utf8*)"simsun");

using namespace CEGUI;

Window* sheet =
WindowManager::getSingleton().loadWindowLayout(
(CEGUI::utf8*)"Login.layout.xml");
mGUISystem->setGUISheet(sheet);

}

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: how can I show my ceguilayout and the ogre overlay at th

Postby spannerman » Thu Apr 14, 2005 16:47

I believe that the OGRE overlay is hiding all your CEGUI renderables, including your mouse. I dont know if it possible to change the z-order of overlays so that they appear behind CEGUI widgets...perhaps you should ask them about this over at the OGRE fourms?

Alternatively, you could use a large StaticImage instead of an overlay to display the background image.

User avatar
jasom_liu
Just popping in
Just popping in
Posts: 14
Joined: Mon Mar 07, 2005 08:00

Re: how can I show my ceguilayout and the ogre overlay at th

Postby jasom_liu » Sun Apr 17, 2005 05:48

Thanks,I have done it~

User avatar
zander1976
Just popping in
Just popping in
Posts: 7
Joined: Fri Apr 08, 2005 13:32
Contact:

Re: how can I show my ceguilayout and the ogre overlay at th

Postby zander1976 » Mon Apr 25, 2005 18:55

Hello

I am trying to do the same thing with ogre as well. I was wondering if you could post the solution.

Thanks, Ben

ps. Try using [ code ] [ /code ] without spaces and the smilies will not show up.

User avatar
jasom_liu
Just popping in
Just popping in
Posts: 14
Joined: Mon Mar 07, 2005 08:00

Re: how can I show my ceguilayout and the ogre overlay at th

Postby jasom_liu » Tue Apr 26, 2005 07:28

You just need to change the next parameter "false" to "true" :)
// setup GUI system
mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000);

User avatar
zander1976
Just popping in
Just popping in
Posts: 7
Joined: Fri Apr 08, 2005 13:32
Contact:

Re: how can I show my ceguilayout and the ogre overlay at th

Postby zander1976 » Tue Apr 26, 2005 13:30

Hey, great.

Worked like a charm. There are some changes with Ogre1.0.

Code: Select all


    void createScene(void)
    {

      //My Ogre Overlay
      Overlay *lay = OverlayManager::getSingleton().create ("background");
      OverlayContainer* cont = (OverlayContainer*)OverlayManager::getSingleton().createOverlayElement("Panel", "Login");
      MaterialPtr pMat = MaterialManager::getSingleton().create( "TextMat",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
      pMat->getTechnique(0)->getPass(0)->createTextureUnitState( "Login.jpg" );
      cont->setMaterialName("TextMat");
      lay->setZOrder(500);
      lay->add2D(cont);
      lay->show();

      // setup GUI system
      mGUIRenderer = new CEGUI::OgreRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, true, 3000);

      mGUISystem = new CEGUI::System(mGUIRenderer);

      // load scheme and set up defaults
      CEGUI::SchemeManager::getSingleton().loadScheme(
         (CEGUI::utf8*)"TaharezLook.scheme"
      );
      mGUISystem->setDefaultMouseCursor(
         (CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow"
      );
      //Tahoma-12
      mGUISystem->setDefaultFont((CEGUI::utf8*)"Tahoma-12");
      //mGUISystem->setDefaultFont((CEGUI::utf8*)"simsun");

      using namespace CEGUI;

      Window* sheet = WindowManager::getSingleton().loadWindowLayout(
         (CEGUI::utf8*)"Login.layout"
      );
      mGUISystem->setGUISheet(sheet);
   }


Thanks, Ben


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 14 guests