Overlay

skorpio

05-05-2008 04:37:17

Hello,

I'm trying to get to the data stored inside an overlay file from the file name
For Example:
Example-Dyn Tex.overlay has
Example/DynTexOverlay
Example/VolTexOverlay

I can get to the resources but then I get stuck


self.overlayList = ogre.ResourceGroupManager.getSingleton().findResourceNames("General", "*.overlay")


I would like to use this at the end.

self.ogreWin.showDebugOverlay(True, overlay)


I can't get to the data. Any help would be appreciated.

Thank,

bharling

06-05-2008 11:57:24

showDebugOverlay is not a generic function, its part of the example framework, and specifically shows the fps box on the bottom left, have a look at the frameListener class in sf_OIS.py, this shows how the function works.

as for getting the actual overlay names, I'm not sure, but you probably have to use the resourceManager classes, I think there's a parseScript() function that might return the data you need ( ie: names of actual overlays contained in scripts).

skorpio

06-05-2008 15:36:39

Yes,

I made a mistake, the code that I want it to use is this


self.overlay = ogre.OverlayManager.getSingleton().getByName(overlayElement)



Thanks for your help. I did find what I need it



overlayManager = ogre.OverlayManager.getSingleton()
overlayIterator = overlayManager.getOverlayIterator();
while (overlayIterator.hasMoreElements()):
ovrlay = overlayIterator.getNext();
self.overlayList.append(ovrlay.getName())




This is now part of a control panel for wxOgre


Skorpio

skorpio

06-05-2008 15:37:26

Yes,

I made a mistake, the code that I want it to use is this


self.overlay = ogre.OverlayManager.getSingleton().getByName(overlayElement)



Thanks for your help. I did find what I need it



overlayManager = ogre.OverlayManager.getSingleton()
overlayIterator = overlayManager.getOverlayIterator();
while (overlayIterator.hasMoreElements()):
ovrlay = overlayIterator.getNext();
self.overlayList.append(ovrlay.getName())




This is now part of a control panel for wxOgre


Skorpio