Console
console.log("Hello, World!")
Print a message to the console
App
Find the first node named "Circle"
app.createPixelNode("Circle")
app.createFloatNode("Value")
app.createDataNode("Text")
Create nodes and add them to the center of the canvas
Node
console.log(self.name)
Print the current JavaScript node name
self.position.x += 100 / sqrt(0.75)
Moves the current node one grid step to the right
self.inputs.forEach( inputNode =>
console.log(inputNode.name)
)
self.outputs.forEach( outputNode =>
console.log(outputNode.name)
)
Print all connected node names
Properties
app.node("Circle").property("Radius").value = 1.0
Scale the Radius of a Circle Pixel Node
app.node("Noise").property("Colored").toggle()
Toggles the Colored property of a Node Pixel Node
app.node("Noise").property("Position").point.x += 0.1
Move the x axis of a Noise Pixel Node
app.node("Rectangle").property("Size").size.width = 0.125
Set the width of a Rectangle Pixel Node
app.node("Image").property("Files").action()
Open the file picker for an Image Pixel Node
let resolution = app.node("Circle").property("Resolution").resolution
resolution.width = 1920
resolution.height = 1080
Set the resolution of a Pixel Node
let color = app.node("Circle").property("Color").color
// RGB
color.red = 0.0
color.green = 1.0
color.blue = 0.0
// HSB
color.hue = 1.0 / 3.0
color.saturation = 1.0
color.brightness = 1.0
// Alpha
color.alpha = 1.0
Color the Circle Pixel Node green
app.node("JSON").property("URL").text = "http://some.site/file.json"
Set the URL of a JSON Data Node
let uniform = app.node("Metal").property("Variable 1").uniform
uniform.name = "myValue"
uniform.value = Math.sqrt(0.75)
Update a Uniform of a Metal Pixel Node
Pixel Node
let pixelNode = app.node("Circle")
pixelNode.resolution.width = 1920
pixelNode.resolution.height = 1080
Get a Pixel Node and set it's resolution
app.node("Circle").render()
Render the Pixel Node
Float Node
app.node("Value").floats
Get the float values of a Float Node
Data Node
let dataNode = app.node("Text")
dataNode.text = "Hello, World!"
Change the text or code of a Data Node
let javaScriptNode = app.node("JavaScript")
javaScriptNode.runCode()
Runs JavaScript Code
Project
Access the current project
app.project.isFocused
Check if the project is in focus
Window
Access the currently focused window
Access all windows in the project (macOS)
Area
app.project.window.area
Access the currently focused area
app.project.window.areas
Access the all areas in the current focused window (iPadOS & macOS)
app.project.window.area.currentMapNode
Access the current map node of an Area
You can check if a window or area is in focused with:.isFocused
You can compare windows and areas with: .id
Root Map Node
app.project.rootMapNode
Access the root Map Node
app.project.rootMapNode.nodes
Access nodes
Fullarea & Fullscreen
let circle = app.node("Circle")
circle.enterFullarea()
circle.exitFullarea()
circle.enterFullscreen()
circle.exitFullscreen()
Enters and Exists Fullarea and Fullscreen