Game Development Community

Custom Mouse Detection Area

by Aditya Kulkarni · in Torque Game Builder · 01/30/2010 (1:22 am) · 2 replies

Can I define a custom area for mouse detection [onMouse (Down/Up/Enter/Leave)] for a GUI element?

The black border defines the mouse area for the polygon. Current behaviour is shown in fig (a), I want it to behave like fig (b).

img22.imageshack.us/img22/7264/mousedetection.png

#1
01/31/2010 (8:15 am)
If you use a static sprite as your GUI element, by turning on its collision properties you can define the collision bounds like fig (b). Mouse events would only then occur within the collision bounds and not the entire sprite's bounding box.
#2
02/01/2010 (2:23 am)
I tried doing that using guiT2DObjectCtrl, gives me 'unable to instantiate' console error. I don't have the source to add it to the engine...

Now I am thinking of creating the 'gui' directly in the level editor.