Does anybody know the the best way to add a clickable interface to a game (without maxgui) eg bitmap buttons to click on. My old way had each button object knowing its coordinates and when the mouse was clicked it would go through each button and check to see if it had been clicked. The main problem with this, of course, is that the more buttons you add, the longer it takes.
My new idea is to have a 2d array the size of the screen, so each pixel references a button object to execute (or no button). This means it will take the same amount of time to click a button, and will also allow irregular shaped buttons, but use more memory.
Any other ideas?
My new idea is to have a 2d array the size of the screen, so each pixel references a button object to execute (or no button). This means it will take the same amount of time to click a button, and will also allow irregular shaped buttons, but use more memory.
Any other ideas?