Handling mouse events are quite strait forward. Lets jump to the code and I'll explain. I assume you have read the previous posts. The header file doesn't have anything special! Just our standard Scene/Layer header... #ifndef … [Continue reading]
Mouse
Keyboard
From the main post, we saw that there are three steps to setup an input device. Create a listener Assign callback functions to events Add the listener to _eventDispatcher. To setup the keyboard listener, just create an … [Continue reading]
Input Devices
Inputs in Cocos2d-x are event driven. Every time you touch the screen or press a key on the keyboard, an event is sent and you can process the data from those input devices in your event callbacks. Note that your class should inherit from the … [Continue reading]
Layer
The Layer is a subclass of Node that implements the TouchEventDelegate protocol. If you need to access to inputs from Keyboard, Touch, Mouse or the Accelerometer, you should use a Layer class. Layers work a bit like Photoshop layers! In your game, … [Continue reading]
Scene Transitions
Transitions How To Use Samples Transitions Transitions are effects that we can use with replaceScene() to make it more interesting. They are a bit similar to Node Actions that we have seen before. Here is a list of the transition … [Continue reading]
- « Previous Page
- 1
- 2
- 3
- 4
- …
- 7
- Next Page »