forked from geode-sdk/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeEvent.hpp
More file actions
35 lines (26 loc) · 1.08 KB
/
NodeEvent.hpp
File metadata and controls
35 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "../loader/Event.hpp"
namespace geode {
enum class NodeEventType {
/// Fired when a CCNode is added to the scene tree.
OnEnter,
/// Fired when a CCNode is removed from the scene tree.
OnExit,
/// Fired when a CCNode is already added to the scene tree but after a scene transition.
OnEnterTransitionDidFinish,
/// Fired when a CCNode is about to be removed from the scene tree before a scene transition.
OnExitTransitionDidStart,
/// Fired when a CCNode is cleaned up (Schedules removed and Actions stopped).
OnCleanup,
};
/// Fired when a CCNode has a specific Event in NodeEventType.
class NodeEvent : public GlobalEvent<NodeEvent, bool(), cocos2d::CCNode*, NodeEventType> {
public:
using GlobalEvent::GlobalEvent;
};
/// Fired when a CCMenuItem is Activated (after the callback).
class MenuItemActivatedEvent : public Event<MenuItemActivatedEvent, bool(cocos2d::CCMenuItem*), cocos2d::CCMenuItem*> {
public:
using Event::Event;
};
}