Hi, i been trying to figure out how to create a Button Class as a subclass of either CCLayer or CCMenuItemImage.
I been wrecking my head for days but i cant seem to get the correct result.
I am trying to make a Button class that works in a way that,
- it will only respond when i touch the area of Button Image (i created a function that check if the touch is within the area of the image) [Thinking if there is any other better way]
- Able to Hold down the button
- Change Image from normalImage to selectedImage when i hold down
- If Button is pressed once, it can swiftly change to selectedImage than back to normalImage.
Early Thanks for anyone who help, been on this for days
I tried to follow the CCMenuItemImage about closenormal on HelloWorld but i cant hold down the button