Fontdef / Overlay scripts are not working for me

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
OGREHEAD
Goblin
Posts: 260
Joined: Tue Feb 02, 2010 6:25 pm
x 2

Fontdef / Overlay scripts are not working for me

Post by OGREHEAD »

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?
User avatar
dark_sylinc
OGRE Team Member
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

Post by dark_sylinc »

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.
OGREHEAD
Goblin
Posts: 260
Joined: Tue Feb 02, 2010 6:25 pm
x 2

Re: Fontdef / Overlay scripts are not working for me

Post by OGREHEAD »

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.
User avatar
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

Post by c6burns »

I believe you have to initialize the overlay system before your resource groups. That's the way the tutorial framework does it.
OGREHEAD
Goblin
Posts: 260
Joined: Tue Feb 02, 2010 6:25 pm
x 2

Re: Fontdef / Overlay scripts are not working for me

Post by OGREHEAD »

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...
Last edited by OGREHEAD on Fri Feb 28, 2014 5:17 pm, edited 1 time in total.
User avatar
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

Post by c6burns »

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:

Code: Select all

// initialize the OverlaySystem (changed for 1.9)
mOverlaySystem = new Ogre::OverlaySystem();
mSceneMgr->addRenderQueueListener(mOverlaySystem);
mOverlaySystem is an Ogre::OverlaySystem*

You can check out the whole framework here:
http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
drwbns
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

Post by drwbns »

Ah thank you c6burns, I was wondering how Ogre wasn't parsing the Overlays in OgreCore.zip, I'll try this out, thanks.
Post Reply