From 1bdc6b8fb8fbc1a1a11275ad4e4a1b3633f9e924 Mon Sep 17 00:00:00 2001 From: Javi Agenjo Date: Thu, 7 Jun 2018 19:05:41 +0200 Subject: [PATCH] Update README.md --- guides/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guides/README.md b/guides/README.md index ebd024e30..aa92945fe 100644 --- a/guides/README.md +++ b/guides/README.md @@ -26,6 +26,18 @@ Slots have the next information: To retrieve the data traveling through a link you can call node.getInputData or node.getOutputData +### Define your Graph Node + +When creating a class for a graph node here are some useful points: + +- The constructor should create the default inputs and outputs (use ```addInput``` and ```addOutput```) +- Properties that can be edited are stored in ```this.properties = {};``` +- the ```onExecute``` is the method that will be called when the graph is executed +- you can catch if a property was changed defining a ```onPropertyChanged``` +- you must register your node using ```LiteGraph.registerNodeType("type/name", MyGraphNodeClass );``` +- you can alter the default priority of execution by defining the ```MyGraphNodeClass.priority``` (default is 0) +- you can overwrite how the node is rendered using the ```onDrawBackground``` and ```onDrawForeground``` + ## Integration