Game Development Community

Bounding Box Question

by Mike Wright · in Torque Game Builder · 03/02/2007 (8:15 am) · 2 replies

I'm looking for some help with bounding boxes. Basically, we have a game with a bunch of T2DStaticSprites on the screen. We want the player to be able to click on these items. We are currently using mouse events on the bounding box of each item to determine if a player has clicked on an item. The problem is, the bounding box is not always a good match for the shape of the T2DStaticSprite. For example, if I have an open umbrella on screen as a T2DStaticSprite, there is a lot of space in the bounding box that is outside of the image of the umbrella.


Is there a better way to make a shape that matches the shape of the image on screen that can also accept mouse events? Thanks for any help.

#1
03/02/2007 (11:32 am)
Mouse events take the object's collision poly into account. Try making a collision poly that more closely matches the shape of your object.
#2
03/05/2007 (8:24 am)
Thanks Thomas! That worked. The help is much appreciated!