Hi all,
Loving Codea, seeing this as a good entry level to iOS after trying (and failing!) to learn Obj-C and then Cocos2D. I’m not a coding newbie as such as my day-to-day job is PHP coding, plus i used to code in BASIC and have dabbled with various languages.
Anyways, been tinkering today with Codea and wondered how to ‘detect’ a touch on a shape/sprite.
For example, I’m creating a UI test and have made simple “left”, “right” and “fire” buttons for a mock Space Invaders type game.
I can get touch co-ordinates I guess, but I’m assuming there is a better solution to this?
Also I’ve added a class called “Buttons” but not sure if this is the right way to create the UI? Guess I’d have to create the buttons something like;
leftButton = Button(color, xco-ord, yco-ord) …?
Would that work? If so, I guess the answer I’m looking for would be
leftButton.touch ?
Thanks for any help.
Paul