Game Development Community

Game Build on Mac Loses Mouse and Clicks (Resolved)

by Charlie Patterson · in iTorque 2D · 03/02/2013 (11:08 am) · 5 replies

I'm trying to get my TGB game ported to iT2D and I've had a few problems.

I've ported over (mostly) the code. When I compile the game for Mac (buildFiles/Xcode), the game pops up. Yay!

Unfortunately, the mouse disappears when it enters the game window. No clicks are registered that I can tell. I've even laced the C++ code to notice if dispatchMouseEvent() is called. Nothing.

Does anyone know the basics of getting this working? Some code I need that isn't present in game.cs or main.cs?

I did read O'Kane's post and I've read through the "Official Release Blog" but I'm still missing something.

Grateful for any help!

#1
03/03/2013 (6:44 am)
@Charlie - What version of OS X are you running on?
#2
03/03/2013 (8:45 am)
Good point. I kept it a little older on purpose, assuming that's useful?

OSX 10.6.8.
Xcode 3.2.6
iT2D 1.5
#3
03/18/2013 (2:35 pm)

Same problem here.
Game runs in windowed mode, standard mouse cursor visible, no clicks accepted in the game, stuck on main screen.

OSX 10.6.8
Xcode 3.2.5
Torque 2D pro 1.7.6

Help would be greatly appreciated!
#4
03/21/2013 (10:52 am)
Well, you have the opposite problem as me, then. But I thought I'd reply anyway. When I compiled for iT2D 1.5 as a Mac app (NOT as an iOS app), I had no cursor and therefore no clicks.

To fix it I went into levelManagement.cs and updated the call to hideCursor as follows:

function t2dSceneWindow::loadLevel(%sceneWindow, %levelFile)
{
...

if($platform $= "iOS")
hideCursor();

...
}

Problem fixed!
#5
03/21/2013 (10:55 am)
P.S. I also had removed the cursor.png file from my images directory. Heh. I put one back from the original templates.