Fontdef / Overlay scripts are not working for me
-
- Goblin
- Posts: 260
- Joined: Tue Feb 02, 2010 6:25 pm
- x 2
Fontdef / Overlay scripts are not working for me
Have something been changed for 1.9 with regards to fontdef and overlay scripts?
I tried to make a overlay script and a fontdef script file in another folder where a material file is located and parses fine.
But when starting log just says adding resourcelocation but nowhere does it actually parse neither the fontdef file nor the overlay file.
I have also tried with the files that comes with ogre, but it is just like it does not see the files are there.
I am also doing this:
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
I can not figure out why my fontdef and overlay script files are not parsed when starting.
What could I be missing?
I tried to make a overlay script and a fontdef script file in another folder where a material file is located and parses fine.
But when starting log just says adding resourcelocation but nowhere does it actually parse neither the fontdef file nor the overlay file.
I have also tried with the files that comes with ogre, but it is just like it does not see the files are there.
I am also doing this:
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
I can not figure out why my fontdef and overlay script files are not parsed when starting.
What could I be missing?
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: Fontdef / Overlay scripts are not working for me
In 1.9 Overlay was moved to its own component (outside of OgreMain aka Core). Fonts were moved alongisde Overlay.
May be you're not linking against OgreOverlay_d.lib (Debug) & OgreOverlay.lib in Release mode.
May be you're not linking against OgreOverlay_d.lib (Debug) & OgreOverlay.lib in Release mode.
-
- Goblin
- Posts: 260
- Joined: Tue Feb 02, 2010 6:25 pm
- x 2
Re: Fontdef / Overlay scripts are not working for me
It took me a while to figure out how to fix the overlay link requirement.
I knew it had changed I just did not know how to fix it.
But I have done this also, before I posted the first message and I think that I have done this correctly.
Before it would not compile when I tried to create overlay in code.
But it is like fonts and overlay scripts are just ignored completely.
And I do not get any errors in my log file.
I will try to reinstall latest ogresrc and see if that changes anything.
I knew it had changed I just did not know how to fix it.
But I have done this also, before I posted the first message and I think that I have done this correctly.
Before it would not compile when I tried to create overlay in code.
But it is like fonts and overlay scripts are just ignored completely.
And I do not get any errors in my log file.
I will try to reinstall latest ogresrc and see if that changes anything.
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: Fontdef / Overlay scripts are not working for me
I believe you have to initialize the overlay system before your resource groups. That's the way the tutorial framework does it.
-
- Goblin
- Posts: 260
- Joined: Tue Feb 02, 2010 6:25 pm
- x 2
Re: Fontdef / Overlay scripts are not working for me
I do this...
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
And later I do this...
OverlayManager1 = OverlayManager::getSingletonPtr();
OverlayManager1->getByName( "GUI1" )->show();
And get crash...
Registering ResourceManager for type Font
"return code 0"
So it sounds like it has not been initialised, like you say c6burns.
I tried doing this instead...
OverlaySystem* OverlaySystem1 = new OverlaySystem();
SceneManager1->addRenderQueueListener( OverlaySystem1 );
TextureManager::getSingleton().setDefaultNumMipmaps( 5 );
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Now I can see fontdef and overlay scripts in log file and GUI works OK again.
Thanks for solution c6burns...
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
And later I do this...
OverlayManager1 = OverlayManager::getSingletonPtr();
OverlayManager1->getByName( "GUI1" )->show();
And get crash...
Registering ResourceManager for type Font
"return code 0"
So it sounds like it has not been initialised, like you say c6burns.
I tried doing this instead...
OverlaySystem* OverlaySystem1 = new OverlaySystem();
SceneManager1->addRenderQueueListener( OverlaySystem1 );
TextureManager::getSingleton().setDefaultNumMipmaps( 5 );
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Now I can see fontdef and overlay scripts in log file and GUI works OK again.
Thanks for solution c6burns...
Last edited by OGREHEAD on Fri Feb 28, 2014 5:17 pm, edited 1 time in total.
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: Fontdef / Overlay scripts are not working for me
I think a good place to init the overlay system is right after you create your scene manager, which should happen before initializing any resource groups. Tutorial framework does it like this:
mOverlaySystem is an Ogre::OverlaySystem*
You can check out the whole framework here:
http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
Code: Select all
// initialize the OverlaySystem (changed for 1.9)
mOverlaySystem = new Ogre::OverlaySystem();
mSceneMgr->addRenderQueueListener(mOverlaySystem);
You can check out the whole framework here:
http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
-
- Orc Shaman
- Posts: 788
- Joined: Mon Jan 18, 2010 6:06 pm
- Location: Costa Mesa, California
- x 24
Re: Fontdef / Overlay scripts are not working for me
Ah thank you c6burns, I was wondering how Ogre wasn't parsing the Overlays in OgreCore.zip, I'll try this out, thanks.