2016-02-18 20:05:23 -05:00
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
# About advancedEventsExample
|
2016-02-18 20:05:23 -05:00
|
|
|
|
|
|
|
|

|
2016-02-18 18:25:37 -05:00
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
### Learning Objectives
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-18 20:05:23 -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
|
|
|
|
2016-02-18 20:05:23 -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
|
|
|
|
2016-02-18 20:05:23 -05:00
|
|
|
In the code, pay attention to:
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-18 20:05:23 -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
|
|
|
|
|
|
2016-02-18 20:05:23 -05:00
|
|
|
When launching this app, you should see a screen with
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-18 20:05:23 -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
|
|
|
|
2016-02-18 20:05:23 -05:00
|
|
|
Instructions for use:
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-18 20:05:23 -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
|
|
|
|
2017-04-18 12:39:29 +02:00
|
|
|
### Other classes used in this file
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-19 15:22:48 -05:00
|
|
|
This Example uses the following classes:
|
2016-02-18 18:25:37 -05:00
|
|
|
|
2016-02-19 15:22:48 -05:00
|
|
|
* [ofxiOS](http://openframeworks.cc/documentation/ofxiOS/) (for compiling openFrameworks to an Apple iOS device)
|
2016-02-18 20:05:23 -05:00
|
|
|
* ofEvents (for ofEventArgs and ofEvents)
|