Skip to content

Commit cd330ef

Browse files
authored
add warning ahh todo to event docs
hopefully temporary only for a few days max lol
1 parent 01c532e commit cd330ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tutorials/events.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Events
22

3+
> :warning: This section of the documentation is currently out of date. Please see [the v5 migration guide](tutorials/migrate-v5) for differences required for Geode v5.
4+
35
For most things in GD, such as `CCTextInputNode`, GD and Cocos2d-x use a **delegate-based event system**, where you install a delegate on the target class, and the delegate receives events via overridden virtual functions. This system works fine for most situations, but is often quite clumsy to use and runs into a few important issues: you have to manually deal with removing the delegate if the target class outlives the delegate, and more importantly, you can only have one delegate per target.
46

57
As an alternative to this system, Geode introduces **events**. Events are essentially just small messages broadcast across the whole system: instead of having to install a single delegate, an unlimited number of classes can listen for events. The target that emits the events does not need to have any knowledge of its consumers; it just broadcasts events, and any receivers there are can handle them.

0 commit comments

Comments
 (0)