Game Development Community

iT2D 1.4 RC1- Using GUI causes all objects to disappear in OSX iTGB editor - RESOLVED

by Johnny Vo · in iTorque 2D · 07/07/2010 (4:07 am) · 6 replies

Build: 1.4 RC1

Platform: OS X 10.6.4, iTGB

Target: iTGB

Description:

Critical bug!

Pushing a GUI onto a level will cause all objects on the level to not show up. Basically you only see the GUI.
For me this didn't happen on Windows 64 bit ultimate but on my Mac OSX 10.6.4. This is also okay on the device.

Note: None of the example projects use GUI!

Steps to Repeat:

1. Create a a project.
2. Put a couple of sprites on the main level.
3. Add a GUI

Observe the GUI shows up but the sprites do not appear.

#1
07/07/2010 (6:36 am)
Do you have any specifics on what kind of gui you add etc?
I ask cause you potentially replace the original setup and drop out the whole regular drawing window that way
#2
07/07/2010 (8:03 am)
1. Can you post the GUI object's code?

2. Does this only happen on OSX?

3. What about the device?

4. does the GUI use an image or datablock at all?
#3
07/07/2010 (11:11 am)
The odd thing is the exact same code works fine on my Windows machine. This only happens in OSX. The GUI uses an image button which shows up fine.

*update* Just tested on the device and it works fine! But running in the editor still has that problem.

Here's the code for the GUI.
if(!isObject(GuiModelessDialogProfile)) new GuiControlProfile("GuiModelessDialogProfile")
{
   modal = false;
};

// --- Start theMainMenuGUI ---
new GuiControl(theMainMenuGui) {
   canSaveDynamicFields = "0";
   //Profile = "GuiModelessDialogProfile";
   Profile = "GuiDefaultProfile";
   HorizSizing = "right";
   VertSizing = "bottom";
   Position = "0 0";
   Extent = "75 150";
   MinExtent = "8 2";
   canSave = "1";
   Visible = "1";
   hovertime = "1000";

   // Test Button.
   new GuiBitmapButtonCtrl(buttonLevel5) 
   {
      canSaveDynamicFields = "0";
      isContainer = "0";
      Profile = "AudibleButtonProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "87 235";
      Extent = "140 38";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      Command = "movePlayer();";
      hovertime = "1000";
      groupNum = "-1";
      buttonType = "PushButton";
      useMouseEvents = "0";
      bitmap = "./btn_img/bt_level5";
   };

};

Here's the code changes in game.cs (not much just exec the gui and pop it into the canvas).

function startGame(%level)
{
   exec("~/gui/gui.gui");
   
   Canvas.setContent(mainScreenGui);
   
   new ActionMap(moveMap);   
     //  moveMap.bind(joystick0, xaxis, "joystickMoveX" );
     //  moveMap.bind(joystick0, yaxis, "joystickMoveY" );
     //  moveMap.bind(joystick0, Zaxis, "joystickMoveZ" );
   moveMap.push();
   
   
   $enableDirectInput = true;
   activateDirectInput();
   enableJoystick();
   
   //Time to start game is measured from the very entry point, until now
   %runTime = getRealTime() - $Debug::loadStartTime;
   echo(" % - Game load time : " @ %runTime @ " ms");
   
   sceneWindow2D.loadLevel(%level);
   
   Canvas.pushDialog(theMainMenuGui);
}
#4
08/19/2010 (5:46 am)
This is still a problem in the current version of iTGB 1.4 on OSX (not device).
#5
08/24/2010 (8:41 pm)
Logged in Jira bug tracker as ITGB-82.
#6
03/09/2011 (2:37 pm)
Fixed in 1.4.1.