CE Scene Graph Component
Scene graph component
Example
/// @desc Parent's Create Event
ce_init_components();
scene_graph = ce_add_component(id, ce_scene_graph_component);
// Add children to the scene graph
var _child = instance_create_layer(x, y, layer, OChild);
ce_scene_graph_add(scene_graph, _child.scene_graph);
// Trigger an event within all children and their children etc.
ce_scene_graph_trigger_event(scene_graph, "my_event", undefined, true,
CE_EEventBubble.Down);
/// @desc Child's User Event
switch (ce_get_event())
{
case "my_event":
show_debug_message("Got it!");
break;
}
Installation
Using Catalyst, the open-source package manager for GameMaker Studio 2:
catalyst require slagtand-org/ce-scene-graph-component
Related
This library is a part of project CE. For more information, please visit the project's repository: https://github.com/slagtand-org/ce