Intermediate Tutorial 2 Help

blz

25-10-2011 16:35:30

Hello,

I've been working on the python-ogre intermediate tutorial #2. There seems to be a compatibility issue with CEGUI and the current version of python-ogre.

I've managed to get a semi-working tutorial script by substituting the following code in the _createscene method:


# Set up the CEGUI Renderer
self.ceguiRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow, ogre.RENDER_QUEUE_OVERLAY, False, 3000, self.sceneManager)
self.ceguiSystem = CEGUI.System(self.ceguiRenderer)
# Show the mouse cursor
CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLookSkin.scheme")
CEGUI.MouseCursor.getSingleton().setImage("TaharezLook", "MouseArrow")


with this code taken from the minmal application code snippet on the python-ogre wiki:


if CEGUI.Version__.startswith("0.6"):
CEGUI.SchemeManager.getSingleton().loadScheme("TaharezLookSkin.scheme")
self.ceguiRenderer = CEGUI.OgreCEGUIRenderer(self.renderWindow,
ogre.RENDER_QUEUE_OVERLAY, False, 3000, sceneManager
)
else:
self.ceguiRenderer = CEGUI.OgreRenderer.bootstrapSystem()
self.system = CEGUI.System.getSingleton()
CEGUI.SchemeManager.getSingleton().create("TaharezLookSkin.scheme")

self.system.setDefaultMouseCursor("TaharezLook", "MouseArrow")


At this point, the python-ogre application will start, but there is no CEGUI mouse cursor (or indeed no GUI assets at all).

I am at the point in the tutorial where I am told that I should be able to execute the code and see a cursor at the top-left corner of the screen. That is to say, I have not yet proceeded to the "Introducing the MouseQueryListener" section and beyond.

My question is the following: what am I missing? Is this behavior normal (i.e., I can proceed with the tutorial), or is there something missing from the code? Will the tutorials be updated soon? It's hard to make sense of them in their current state.

In case it's relevant, here is a pastebin of the full code for intermediate_2.py: http://pastebin.com/JG5aXGL1

Any help is greatly appreciated. Thank you!

dermont

25-10-2011 20:22:24

I think setDefaultMouseCursor only works if you have a CEGUI window, in your case it should probably be:

CEGUI.MouseCursor.getSingleton().setImage("TaharezLook", "MouseArrow")

http://www.ogre3d.org/tikiwiki/Basic+Tutorial+7

blz

25-10-2011 20:59:52

I think setDefaultMouseCursor only works if you have a CEGUI window, in your case it should probably be:

CEGUI.MouseCursor.getSingleton().setImage("TaharezLook", "MouseArrow")


Words cannot describe how much I love you right now. Kudos to you! This thread is officially solved!

Is there a way I could modify this in the wiki, for posterity?

dermont

27-10-2011 12:04:09


Is there a way I could modify this in the wiki, for posterity?


I think you may now need a login to modify content on the wiki page. If you need help/clarification best to PM Andy(the moderator), he will put you on the right track.