Game Development Community

A couple iTGB questions...

by Daniel Hopkins · in iTorque 2D · 01/10/2010 (6:37 pm) · 4 replies

Hey,

I have two questions regarding the workins of iTGB 1.3.

First of all, iTGB 1.3 will now automatically load the necessary datablocks for a level via executing the "levelname_datablocks.cs" file. However, does it automatically clear those datablocks when loading a new level? Or do I have to do something like:

$levelDatablocks.delete(); //call this before loading a new level to clear current level datablocks
loadlevel( [level] );

Second, is there a way to use the "oniPhoneTouch[down/up]" functions on a per-object basis. In other words, is it possible to set up a class or behavior to handle those callbacks on objects they are assigned too, or do I have to use the global callbacks, cycle through all the touch points, and figure out which objects were touched manually?



#1
01/12/2010 (1:46 pm)
Technically, a touch is also registered as an onMouseDown event with the object, so any mouse commands would also work. Multitouch for objects was added into the engine for 1.3 beta, so providing that code hasn't changed you should be good to go treatin object interactions as mouse commands.
#2
01/12/2010 (2:07 pm)
removed again
#3
01/12/2010 (3:11 pm)
Thanks for the comments! After looking through my code again, the problem I was having is I also had an "onMouseLeave" callback which set my button to the "up" state. So, when I would tap another button with another finger, it would call that function on the first button. The short of it is, it works!

@Marc: Actually, I am using T2Di 1.3 and mouse events are being registered on my device. That's what I'm currently using to handle buttons.

So now I'm just wondering about the level datablocks. Do I call delete before loading a new level, or is that done automatically?

Thanks again!
#4
01/12/2010 (3:49 pm)
will have to double check my stuff then.