The game I'm working on uses full width strips of color as buttons for controls, initially there are 2 buttons(strips) which then shrink along their y axis to make room for a 3rd button(strip) and so on until there are 6 buttons. This happens during the course of one layout. Each button does the same thing but passes a different value so my main character can change colors accordingly
I'm wondering what the cheapest way to do this might be, as it is now I have 6 separate sprites which all have an on touch action, I'm sure this is overkill events wise.
I thought perhaps I could use a single sprite containing all the color strips (building up over frames), on touch it would compare the y value and if it corresponded to the location of the color it would then trigger the action. Although I'm not sure how or it's even possible to get the coordinates of a touch event.
Any tips on how to get the touch y value or any other methods that might be more lightweight than my less than elegant solution would be appreciated.
Cheers!