Skip to content

Parallax Background

A background that moves with the camera at a factor (0 = fixed, 1 = world), repeating and optionally drifting.

Type: ParallaxNode · Category: Graphics & Rendering · Also found as: parallax, parallaxlayer

Property Type Default Description
texturePath string "" Background texture.
factor vec2 (0.5, 0.5) Movement relative to the camera: 1 moves with the world, 0 stays fixed on screen. Range 0 to 2.
repeatX boolean true Tile horizontally to fill the view.
repeatY boolean false Tile vertically to fill the view.
scrollSpeed vec2 (0, 0) Drifts by itself (px/s; clouds). Range -1000 to 1000.
tint color #ffffffff Multiplies the texture’s colours (white = unchanged; alpha fades it).

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("texturePath")
  • path ParallaxNodeProperty|string

Returns any

Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.” a field of the node’s script.

self.node:set_property("texturePath", "text")
  • path ParallaxNodeProperty|string
  • value any
  • y? number
{
"type": "ParallaxNode",
"name": "ParallaxBackground",
"position": [
0,
0
],
"properties": {
"texturePath": "",
"factor": [
0.5,
0.5
],
"repeatX": true
}
}