Image Maps
by Juan Aramburu · in Torque Game Engine · 08/01/2006 (3:15 pm) · 5 replies
Is there an easy way to create an imagemap? For example, say I have a huge bitmap with lots of separate vehicles on it, and I want the user to click on one vehicle to make a selection.
The way I'm doing it now is just using a GuiChunkedBitmapCtrl with the bitmap field set as the bitmap I want to use.
Then for each "area" (or vehicle), I have a GuiBitmapButtonCtrl with the bitmap pointing to "transparentdot" (transparentdot_h, _n, _i, _d) which is just a 1 pixel png with transaprent background. It works, but is there a more practical (e.g., standard) way of doing image maps? I've searched & I see some Torque 2D & TGB imagemap-related stuff, but nothing for TGE.

Each 'button' covers a vehicle. They look like big buttons in the editor the first time you add 'em, but after you save the .gui & reload it, they appear as the first area you see over the shown vehicle.
The way I'm doing it now is just using a GuiChunkedBitmapCtrl with the bitmap field set as the bitmap I want to use.
Then for each "area" (or vehicle), I have a GuiBitmapButtonCtrl with the bitmap pointing to "transparentdot" (transparentdot_h, _n, _i, _d) which is just a 1 pixel png with transaprent background. It works, but is there a more practical (e.g., standard) way of doing image maps? I've searched & I see some Torque 2D & TGB imagemap-related stuff, but nothing for TGE.

Each 'button' covers a vehicle. They look like big buttons in the editor the first time you add 'em, but after you save the .gui & reload it, they appear as the first area you see over the shown vehicle.
About the author
#2
08/11/2006 (1:16 pm)
An image map...you've got one big image, but you want to section off portions of the image so that when only that small area of the whole image is clicked, it executes a command.
#3
08/11/2006 (3:44 pm)
I would think you could just use regular bitmap buttons - but with no bitmap. but seeing what you have over your first image... isnt that what you want?
#4
08/11/2006 (4:17 pm)
You could try the button base ctrl
#5
Matthew Langley, I will give that a try.
08/14/2006 (2:58 pm)
Jon Paynter, when you use the GuiBitmapButtonCtrl without specifying an image, that regular button-face color is what is shown like in most of those pictured above. What I have works (GuiBitmapButtonCtrl with a transparent pixel as the bitmap), but was trying to see if there was a more practical (e.g., easier to manage) way. ...Especially since using the gui editor still takes a lot of guesswork when you need to place things accurately.Matthew Langley, I will give that a try.
Associate Anthony Rosenbaum