The main menu, drawn by Scenes and Windows. What This Module Does
reactor_image_layers.js
Map image layers: pictures drawn with a map. A painted map (parallax
mapping), fog, clouds, rain, a far background, a screen overlay; on maps
shown in 2D and in 3D. $dataMap.rrImageLayers lists them in drawing order
(within a position, a later layer is on top). Every field but name and
layer is left out of the file at its default:
Classes & Namespaces
Design Notes from the Source Code
reactor_image_layers.js
Map image layers: pictures drawn with a map. A painted map (parallax
mapping), fog, clouds, rain, a far background, a screen overlay; on maps
shown in 2D and in 3D. $dataMap.rrImageLayers lists them in drawing order
(within a position, a later layer is on top). Every field but name and
layer is left out of the file at its default:
name picture in img/parallaxes, no extension
layer "back" behind the map: under the tiles, over the map's parallax
"ground" below characters: over the lower tiles (default)
"same" same as characters: sorted with them row by row, and
its solid tiles stop movement (fit "map" only)
"over" above characters and the upper tiles
fit "map" locked to the map, one picture the size of the map (default)
"repeat" tiled without end across the view
"fill" stretched to the screen and fixed to it
"place" at its own size, its top-left corner on tile at,
moving with the map (a placed 2D structure)
at [x, y] the tile a "place" layer's top-left corner is on, in
whole tiles (default [0, 0]); written only for fit "place"
repeat the directions a repeating layer repeats in: left out for
across and down, "x" across only (a far mountain strip), "y"
down only (streaks of rain). In the other direction the picture
keeps its own size, lies once, and moves with the map by follow
drift [x, y] pixels per second a repeating layer scrolls by itself,
right and down (negative: left and up); it scrolls only in a
direction it repeats in
follow how much a repeating layer moves with the map: 1 lies on the
map (default), 0 stays on the screen, 0.5 looks far away
opacity 0..255 (default 255)
blendMode 0 normal, 1 add, 2 multiply, 3 screen
switch ID of a switch: shown only while it is ON
when { variable, op: "=" | ">=" | "<=", value }: shown only while
that variable passes the test
fade seconds to appear and disappear when its conditions change
variable ID of a variable that changes the picture
versions { "1": "Town_night", "2": "Town_winter" }: the picture shown
while that variable holds each value; any other value shows name
variantName what an import writes instead of a list: while the variable
is not 0 and has no entry in versions, the layer shows this
name with %1 replaced by the value ("43-%1_Ground" shows
"43-2_Ground" at 2)
A picture whose file is missing shows name.
z a number that replaces the position's depth
Any other field is kept as it is (a placed structure's layers carry
structure2d, the placement they were made for).
A map shown in 3D draws the screen layers only: "over" with fit "fill" or "repeat" (repeating on the screen, follow counting as 0).
The first half of this file is pure: it reads no game global, so the editor loads the same file and names, places, tests and blocks by the same rules. The second half hooks the running game, each hook behind a test for the class it wraps.
View reactor_image_layers.js on GitHub · Show internal (_) functions