views:

11

answers:

1

Hello.

Using Cocos2D, is it possible to create a button which constantly triggers when being touched, instead of triggering just once?

I'm happy to have a timer which does the repeat trigger, so I guess another question is can I use a touch removed with a Cocos2D menu button?

Cheers. :-)

A: 

You don't really need to have a button triggered constantly. If you want to use a button pressed once, to increase the volume or to move something; you can just set a flag (eg: a bool var = true) as when a button-down event is triggered, keep performing your required action, till a button-up event is triggered where you would set your flag to some other state (eg a bool var = false).

Much simpler than using a timer to trigger events.

Food for thought http://en.wikipedia.org/wiki/Functional_fixedness

HyperCas