From bfff0e54c70470b2ddcdda27c268ad4c2bf3d480 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 3 Mar 2023 00:57:12 +1100 Subject: [PATCH] Minor note added --- getting-started/game-engine.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/getting-started/game-engine.md b/getting-started/game-engine.md index d354d9f..10cbb60 100644 --- a/getting-started/game-engine.md +++ b/getting-started/game-engine.md @@ -70,6 +70,7 @@ The rules of execution for scripts and functions is as follows: The following functions, which are defined within the node scripts, are invoked at specific times within the game loop. Note that if you want code to execute *during* node creation, place it within the script's root scope. Variables that you want to persist between calls should also be placed in the script's root. +* `onLoad(node: opaque)` * `onInit(node: opaque)` * `onStep(node: opaque)` * `onFree(node: opaque)` @@ -83,6 +84,8 @@ The following functions, which are defined within the node scripts, are invoked These may change or expand as more input devices are added, and the engine matures. +NOTE: `onLoad()` is invoke every time a node is added to the node tree - but `onInit()` is only invoked once by the engine. After that single invocation, `initNode()` must be called manually on any node children that are loaded later. + # Engine Libraries A series of libraries are provided to allow Toy to interface and control the engine. In addition, the libraries stored within Toy's `repl/` directory are also available (see the main page for the list).