Calling "SceneGraph::onLevelLoaded()" hides the cursor...
by Junsik Shim · in iTorque 2D · 02/13/2010 (3:22 am) · 5 replies
Hello.
When I try to call SomeSceneGraph::onLevelLoaded(),
the cursor just disappears from the screen.
Here are the steps to reproduce:
1. Create a new project.
2. In the "Scene Graph Scripting" section, set the Class field to "EmptySceneGraph".
3. Save the scene, and run it; works fine.
4. Create a new script file named "emptySceneGraph.cs" in "scripts" folder.
5. Put this code into the file.
6. Insert this line into "startGame()" in "game.cs".
7. Save all and run it; the cursor disappears!
Am I missing something?
BTW, I'm using T2Di 1.3.1 on Vista 32bit.
Thanks in advance.
When I try to call SomeSceneGraph::onLevelLoaded(),
the cursor just disappears from the screen.
Here are the steps to reproduce:
1. Create a new project.
2. In the "Scene Graph Scripting" section, set the Class field to "EmptySceneGraph".
3. Save the scene, and run it; works fine.
4. Create a new script file named "emptySceneGraph.cs" in "scripts" folder.
5. Put this code into the file.
function EmptySceneGraph::onLevelLoaded(%this, %scenegraph) {}6. Insert this line into "startGame()" in "game.cs".
exec("./emptySceneGraph.cs");7. Save all and run it; the cursor disappears!
Am I missing something?
BTW, I'm using T2Di 1.3.1 on Vista 32bit.
Thanks in advance.
#2
There's no code in EmptySceneGraph::onLevelLoaded() as I mentioned above. Just calling the function itself is causing this weird problem.
Am I the only one having this problem??
02/14/2010 (12:02 pm)
@SvenThere's no code in EmptySceneGraph::onLevelLoaded() as I mentioned above. Just calling the function itself is causing this weird problem.
Am I the only one having this problem??
#3
You override the t2dSceneGraph::onLevelLoaded thats defined in common/scripts/levelManagement.cs, which actually does the call to showCursor
if you want your overrides to work correctly get used to have a call to the base classes version of the function being the first thing in such an override before anything else happens so you have the "base state" setup correctly
02/14/2010 (12:16 pm)
The problem is one you create yourself.You override the t2dSceneGraph::onLevelLoaded thats defined in common/scripts/levelManagement.cs, which actually does the call to showCursor
if you want your overrides to work correctly get used to have a call to the base classes version of the function being the first thing in such an override before anything else happens so you have the "base state" setup correctly
#4
Oh, I didn't know I was actually overriding the method. I thought I'm just declaring it for the first time. I guess I should take a look at the common scripts for answers now.
Thanks!
02/14/2010 (7:13 pm)
@MarcOh, I didn't know I was actually overriding the method. I thought I'm just declaring it for the first time. I guess I should take a look at the common scripts for answers now.
Thanks!
Associate Sven Bergström
Luma Arcade