How do you usually go about interfaces and menu-screens? I tend to create an array of these objects, and forward clicks out to each of them being shown, but I think thats a weird way of doing it.
I do the same but only send the clicks after having done a contain() to the rect of the element
Mike
I have a framework for a menu system.
I have a Menus class that has an ArrayList of MenuPage’s. MenuPage has an ArrayList of MenuItem’s.
Menus register the mouse and motion listeners and it delegates the events to the current MenuPage shown, which loops through all the MenuItem’s, using item.getBounds().contains(int x,int y), which then delegates it to its handler.
Hope that helped ;D