SIGN IN SIGN UP

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.

0 0 154 C++
# About advancedEventsExample
![Screenshot of advancedEventsExample](advancedEventsExample.png)
2016-02-18 18:25:37 -05:00
### Learning Objectives
2016-02-18 18:25:37 -05:00
This Example demonstrates how you can register custom events in openFrameworks, in an iOS application.
2016-02-18 18:25:37 -05:00
After studying this example, you'll understand how to create an event object, and bind events to it.
2016-02-18 18:25:37 -05:00
In the code, pay attention to:
2016-02-18 18:25:37 -05:00
* The custom object ```eventsObject``` and its corresponding ```newFloatEvent()``` and ```newIntEvent()```.
* ```ofAddListener```, which allows you to bind the events in the custom ```eventsObject``` to methods in your ```ofApp.mm```
* The touchEvent allows you to toggle these custom events on and off.
2016-02-18 18:25:37 -05:00
### Expected Behavior
When launching this app, you should see a screen with
2016-02-18 18:25:37 -05:00
* Instructional Text
* After tapping, you can toggle on/off event information which is drawn to the screen every time the custom events are triggered.
2016-02-18 18:25:37 -05:00
Instructions for use:
2016-02-18 18:25:37 -05:00
* Tap the screen to toggle whether or not the events are triggered (and thereby drawn on screen).
2016-02-18 18:25:37 -05:00
### Other classes used in this file
2016-02-18 18:25:37 -05:00
This Example uses the following classes:
2016-02-18 18:25:37 -05:00
* [ofxiOS](http://openframeworks.cc/documentation/ofxiOS/) (for compiling openFrameworks to an Apple iOS device)
* ofEvents (for ofEventArgs and ofEvents)