Selecting Regions of a map in a GUI Screen
by Julie B · in Torque Game Engine · 11/02/2004 (1:35 pm) · 1 replies
I am trying to created a Real-Time-Strategy style level selection screen (a la Command and Conquer) where you can select which battle you would like to enter next.
I have a map of the world and I want certain sections of it to be selectable. Unfortunately, the sections that I want to click on are not rectangular, and they may be diagonally adjacent to each other (so I do not want the selectable regions to overlap).
What would be the easiest way to do this?
Some potential solutions:
1. Create a special button class that is not rectangular and make a new button for each location that is selectable.
2. Keep track of the x,y coordinates where the mouse was clicked, then iterate over a structure containing information about each selectable area and try to determine if the click was within any of the irregularly shaped selectable regions.
Any thoughts?
I have a map of the world and I want certain sections of it to be selectable. Unfortunately, the sections that I want to click on are not rectangular, and they may be diagonally adjacent to each other (so I do not want the selectable regions to overlap).
What would be the easiest way to do this?
Some potential solutions:
1. Create a special button class that is not rectangular and make a new button for each location that is selectable.
2. Keep track of the x,y coordinates where the mouse was clicked, then iterate over a structure containing information about each selectable area and try to determine if the click was within any of the irregularly shaped selectable regions.
Any thoughts?
About the author
Associate Kyle Carter