Class in reactor_sprites.js

Spriteset_Map

57 public functions in 7 groups · show internal (_) functions

The main menu, drawn by Scenes and Windows.

Familiar territory. Spriteset_Map keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.

Quick Reference

Setup & Creation 15

initialize() Sets up a new instance.
loadSystemImages() Loads the system images.
createLowerLayer() Creates the lower layer.
createParallax() Creates the parallax.
createTilemap() Creates the tilemap.
createReactor3D() Creates the reactor3 d.
createReactor3DSprite() Put the 3D render into the PIXI scene, underneath everything else.
createReactorLighting2D() Creates the reactor lighting2 d.
loadTileset() Loads the tileset.
createCharacters() Creates the characters.
createShadow() Creates the shadow.
createDestination() Creates the destination.
createWeather() Creates the weather.
createNeighborTilemap() The ground of a neighboring map, as a tilemap of its own placed offset tiles from this map's first tile.
createBalloon() Creates the balloon.

Getting Information 1

findTargetSprite() Finds the target sprite.

Checks (True / False) 2

isReactor3DTilesetReady() Whether every tileset sheet this map draws from has finished loading.
isReactor3DArrivalTime() Whether the map this spriteset draws is still loading (its scene not started): the time its world is laid in…

Actions 8

destroy() Culled objects live outside the display tree; fold them back in before teardown so the normal destroy cascade…
releaseReactor3D() Give back the map's 3D world.
hideCharacters() Hides the characters.
destroyReactor3DSprite() Destroy reactor3 d sprite.
finishReactor3DArrival() Whatever of a staged world is still to lay, laid at once (its models are not waited for).
destroyReactorLighting2D() Destroy reactor lighting2 d.
removeBalloon() Removes the balloon.
removeAllBalloons() Removes the all balloons.

Events, Commands & Input 1

processBalloonRequests() Handles the balloon requests.

Updating & Drawing 20

update() Update.
updateParkedWindows() In an update that leaves the culling pass to the frame's last: windows parked off the display list still take…
updateReactor2DCamera() Scale only the map, its weather and native world lighting.
updateOffscreenCulling() Updates the offscreen culling each frame.
updateReactor3DTexture() Hand this frame's 3D render to PIXI.
updateReactor3DArrival() Called on every frame of the map's loading wait (Scene_Map.isReady): the 3D world, built without its pieces a…
updateReactor3DWarm() One unseen draw of a map still loading (updateReactor3DArrival).
updateReactor3D() Follow the player and draw the 3D pass.
drawReactor3D() The passes of this frame's world, from the camera as it stands.
updateReactor3DLights() Give the scene this frame's lights, if the map asked for them.
updateReactorLighting2D() Updates the reactor lighting2 d each frame.
syncReactorFlatLights() Pool the light sprites and place this frame's lights into them.
updateReactor3DCamera() Updates the reactor3 d camera each frame.
updateTileset() Updates the tileset each frame.
updateParallax() Updates the parallax each frame.
updateTilemap() Updates the tilemap each frame.
updateNeighborTilemaps() A 2D map's neighbors (its Beyond the Border sides): each one's ground is a tilemap of its own under this map'…
updateShadow() Updates the shadow each frame.
updateWeather() Updates the weather each frame.
updateBalloons() Updates the balloons each frame.

Other 10

reactor3DModelCharacters() Whoever may stand as a model: the events, the player and the visible followers (an actor bound to a model in…
reactor3DArrivalJob() What the world's later parts are laid from: the map as the scene's build reads it (event tiles written in) an…
reactor3DKeepsLastPicture() The update a border is crossed in (Reactor3D.Neighbors): the scene of the map entered is the world that stood…
keepReactorLighting2DOnTop() Keep the darkness and glow the last things drawn, in that order.
suppressReactor3DGroundParallaxes() Suppress reactor3 d ground parallaxes.
reactor3DGroundParallaxNames() The parallaxes this map's 3D ground was built from, by name.
keepReactor3DLightsOnTop() Keep reactor3 d lights on top.
reactor3DCompany() Who else a wall must not hide: the visible followers, then the nearest events that show a character, within r…
reactor3DCameraFocus() The centre of what the map is displaying, in map coordinates.
animationBaseDelay() Animation base delay.

Setup & Creation

initialize

method source
Spriteset_Map.prototype.initialize()

Sets up a new instance. (Same as the RPG Maker MZ method of this name.)

loadSystemImages

method source
Spriteset_Map.prototype.loadSystemImages()

Loads the system images. (Same as the RPG Maker MZ method of this name.)

createLowerLayer

method source
Spriteset_Map.prototype.createLowerLayer()

Creates the lower layer. (Same as the RPG Maker MZ method of this name.)

createParallax

method source
Spriteset_Map.prototype.createParallax()

Creates the parallax. (Same as the RPG Maker MZ method of this name.)

createTilemap

method source
Spriteset_Map.prototype.createTilemap()

Creates the tilemap. (Same as the RPG Maker MZ method of this name.)

createReactor3D

method source
Spriteset_Map.prototype.createReactor3D()

Creates the reactor3 d. (Same as the RPG Maker MZ method of this name.)

createReactor3DSprite

method source
Spriteset_Map.prototype.createReactor3DSprite(viewport, scene)

Put the 3D render into the PIXI scene, underneath everything else.

Details

Put the 3D render into the PIXI scene, underneath everything else.

The three.js canvas becomes a texture on a full-screen sprite sitting where the tilemap's ground used to be. It costs one full-canvas texture upload per frame — what a video sprite costs — and it buys back every effect that assumed the map was in the scene.

createReactorLighting2D

method source
Spriteset_Map.prototype.createReactorLighting2D()

Creates the reactor lighting2 d. (Same as the RPG Maker MZ method of this name.)

loadTileset

method source
Spriteset_Map.prototype.loadTileset()

Loads the tileset. (Same as the RPG Maker MZ method of this name.)

createCharacters

method source
Spriteset_Map.prototype.createCharacters()

Creates the characters. (Same as the RPG Maker MZ method of this name.)

createShadow

method source
Spriteset_Map.prototype.createShadow()

Creates the shadow. (Same as the RPG Maker MZ method of this name.)

createDestination

method source
Spriteset_Map.prototype.createDestination()

Creates the destination. (Same as the RPG Maker MZ method of this name.)

createWeather

method source
Spriteset_Map.prototype.createWeather()

Creates the weather. (Same as the RPG Maker MZ method of this name.)

createNeighborTilemap

method source
Spriteset_Map.prototype.createNeighborTilemap(map, at, side)

The ground of a neighboring map, as a tilemap of its own placed offset tiles from this map's first tile.

createBalloon

method source
Spriteset_Map.prototype.createBalloon(request)

Creates the balloon. (Same as the RPG Maker MZ method of this name.)

Getting Information

findTargetSprite

method source
Spriteset_Map.prototype.findTargetSprite(target)

Finds the target sprite. (Same as the RPG Maker MZ method of this name.)

Checks (True / False)

isReactor3DTilesetReady

method source
Spriteset_Map.prototype.isReactor3DTilesetReady()

Whether every tileset sheet this map draws from has finished loading.

Details

Whether every tileset sheet this map draws from has finished loading.

createTilemap starts the sheet loads and builds the 3D scene in the same breath, but the textures come from those bitmaps — so building immediately reads them empty and the map comes up blank. The 2D tilemap has no such problem: it redraws itself as each sheet arrives.

isReactor3DArrivalTime

method source
Spriteset_Map.prototype.isReactor3DArrivalTime()

Whether the map this spriteset draws is still loading (its scene not started): the time its world is laid in parts.

Actions

destroy

method source
Spriteset_Map.prototype.destroy(options)

Culled objects live outside the display tree; fold them back in before teardown so the normal destroy cascade reaches them (no leaked textures on map transfer).

Details

Culled objects live outside the display tree; fold them back in before teardown so the normal destroy cascade reaches them (no leaked textures on map transfer). Balloons must end here too: a balloon-wait interpreter polls the character's _balloonPlaying flag, and only removeAllBalloons clears it — skipping it soft-locks the event after a mid-balloon scene change.

releaseReactor3D

method source
Spriteset_Map.prototype.releaseReactor3D(now)

Give back the map's 3D world.

Details

Give back the map's 3D world. With the spriteset, and earlier when another map is loading: the scene left behind is not drawn again, and holding its world through the next map's load put two maps in memory at once.

hideCharacters

method source
Spriteset_Map.prototype.hideCharacters()

Hides the characters. (Same as the RPG Maker MZ method of this name.)

destroyReactor3DSprite

method source
Spriteset_Map.prototype.destroyReactor3DSprite()

Destroy reactor3 d sprite. (Same as the RPG Maker MZ method of this name.)

finishReactor3DArrival

method source
Spriteset_Map.prototype.finishReactor3DArrival()

Whatever of a staged world is still to lay, laid at once (its models are not waited for).

destroyReactorLighting2D

method source
Spriteset_Map.prototype.destroyReactorLighting2D()

Destroy reactor lighting2 d. (Same as the RPG Maker MZ method of this name.)

removeBalloon

method source
Spriteset_Map.prototype.removeBalloon(sprite)

Removes the balloon. (Same as the RPG Maker MZ method of this name.)

removeAllBalloons

method source
Spriteset_Map.prototype.removeAllBalloons()

Removes the all balloons. (Same as the RPG Maker MZ method of this name.)

Events, Commands & Input

processBalloonRequests

method source
Spriteset_Map.prototype.processBalloonRequests()

Handles the balloon requests. (Same as the RPG Maker MZ method of this name.)

Updating & Drawing

update

method source
Spriteset_Map.prototype.update()

Update. (Same as the RPG Maker MZ method of this name.)

updateParkedWindows

method source
Spriteset_Map.prototype.updateParkedWindows()

In an update that leaves the culling pass to the frame's last: windows parked off the display list still take their update, as those on it just did, so a plugin label's fade or timer runs at the game's pace whether parked or not.

updateReactor2DCamera

method source
Spriteset_Map.prototype.updateReactor2DCamera()

Scale only the map, its weather and native world lighting.

Details

Scale only the map, its weather and native world lighting. Pictures, timers and scene UI retain their normal coordinates. The map's display origin already accounts for the focus offset, including edge clamping.

updateOffscreenCulling

method source
Spriteset_Map.prototype.updateOffscreenCulling()

Updates the offscreen culling each frame. (Same as the RPG Maker MZ method of this name.)

updateReactor3DTexture

method source
Spriteset_Map.prototype.updateReactor3DTexture(pass, from)

Hand this frame's 3D render to PIXI.

Details

Hand this frame's 3D render to PIXI.

The canvas is the texture's source, so only the upload has to be asked for; v8 keeps that on source, v5-v7 on baseTexture.

updateReactor3DArrival

method source
Spriteset_Map.prototype.updateReactor3DArrival()

Called on every frame of the map's loading wait (Scene_Map.isReady): the 3D world, built without its pieces and water, has them laid a few chunks a frame (Reactor3D.Arrival.BUDGET_MS).

Details

Called on every frame of the map's loading wait (Scene_Map.isReady): the 3D world, built without its pieces and water, has them laid a few chunks a frame (Reactor3D.Arrival.BUDGET_MS). A world whose tile sheets were still loading as the spriteset was made is built here once they are in. True once the world stands whole, or there is none to wait for.

updateReactor3DWarm

method source
Spriteset_Map.prototype.updateReactor3DWarm(job)

One unseen draw of a map still loading (updateReactor3DArrival).

Details

One unseen draw of a map still loading (updateReactor3DArrival). True once nothing waits to be drawn, or the wait is spent.

updateReactor3D

method source
Spriteset_Map.prototype.updateReactor3D()

Follow the player and draw the 3D pass.

Details

Follow the player and draw the 3D pass.

Runs before the 2D updates so character sprites, which project through this camera, read a camera already aimed at this frame's position rather than the previous one — otherwise they trail the ground by a frame while scrolling.

drawReactor3D

method source
Spriteset_Map.prototype.drawReactor3D(state)

The passes of this frame's world, from the camera as it stands.

updateReactor3DLights

method source
Spriteset_Map.prototype.updateReactor3DLights(state)

Give the scene this frame's lights, if the map asked for them.

Details

Give the scene this frame's lights, if the map asked for them.

Collected from whichever lighting plugin is installed and translated into map coordinates by a shim, so a lantern becomes a sphere of light pooling on the ground and a torch a cone down a corridor, rather than a circle painted flat over the world.

A map that has not asked keeps the plugin's own 2D lightmap and a fully lit scene, which is exactly what it had before.

updateReactorLighting2D

method source
Spriteset_Map.prototype.updateReactorLighting2D()

Updates the reactor lighting2 d each frame. (Same as the RPG Maker MZ method of this name.)

syncReactorFlatLights

method source
Spriteset_Map.prototype.syncReactorFlatLights(state, lights)

Pool the light sprites and place this frame's lights into them.

Details

Pool the light sprites and place this frame's lights into them.

Sprites are reused in order and the leftovers hidden, so a steady map allocates nothing per frame; every sprite shares one of two textures, so hundreds of lights batch into a couple of draws. A light whose reach cannot touch the screen is skipped before it costs a sprite at all.

updateReactor3DCamera

method source
Spriteset_Map.prototype.updateReactor3DCamera()

Updates the reactor3 d camera each frame. (Same as the RPG Maker MZ method of this name.)

updateTileset

method source
Spriteset_Map.prototype.updateTileset()

Updates the tileset each frame. (Same as the RPG Maker MZ method of this name.)

updateParallax

method source
Spriteset_Map.prototype.updateParallax()

Updates the parallax each frame. (Same as the RPG Maker MZ method of this name.)

updateTilemap

method source
Spriteset_Map.prototype.updateTilemap()

Updates the tilemap each frame. (Same as the RPG Maker MZ method of this name.)

updateNeighborTilemaps

method source
Spriteset_Map.prototype.updateNeighborTilemaps()

A 2D map's neighbors (its Beyond the Border sides): each one's ground is a tilemap of its own under this map's, drawn where the view goes past the edge (Game_Map.reactorEdgeReach) and hidden while it does not.

Details

A 2D map's neighbors (its Beyond the Border sides): each one's ground is a tilemap of its own under this map's, drawn where the view goes past the edge (Game_Map.reactorEdgeReach) and hidden while it does not. A neighbor is read in the background as a 3D map's are (Reactor3D.Neighbors.request), from the moment the map is entered. Its events are not drawn; the border is crossed as before.

updateShadow

method source
Spriteset_Map.prototype.updateShadow()

Updates the shadow each frame. (Same as the RPG Maker MZ method of this name.)

updateWeather

method source
Spriteset_Map.prototype.updateWeather()

Updates the weather each frame. (Same as the RPG Maker MZ method of this name.)

updateBalloons

method source
Spriteset_Map.prototype.updateBalloons()

Updates the balloons each frame. (Same as the RPG Maker MZ method of this name.)

Other

reactor3DModelCharacters

method source
Spriteset_Map.prototype.reactor3DModelCharacters()

Whoever may stand as a model: the events, the player and the visible followers (an actor bound to a model in the database sidecar walks the map as that model).

Details

Whoever may stand as a model: the events, the player and the visible followers (an actor bound to a model in the database sidecar walks the map as that model). One list, refilled in place each frame; the sync only walks it.

reactor3DArrivalJob

method source
Spriteset_Map.prototype.reactor3DArrivalJob()

What the world's later parts are laid from: the map as the scene's build reads it (event tiles written in) and its loader.

reactor3DKeepsLastPicture

method source
Spriteset_Map.prototype.reactor3DKeepsLastPicture(state)

The update a border is crossed in (Reactor3D.Neighbors): the scene of the map entered is the world that stood past the border, and the game does not move on this update.

Details

The update a border is crossed in (Reactor3D.Neighbors): the scene of the map entered is the world that stood past the border, and the game does not move on this update. The passes still hold the map left's last picture of that same world, and they show it again; the map entered draws from the next update. The crossing frame then makes the new scene without also drawing the world (a third of it on a fast machine, a whole frame of the GPU on an integrated one). Only where every pass this map shows was drawn together in that last draw, Neighbors.KEEP_PICTURE updates back at most.

keepReactorLighting2DOnTop

method source
Spriteset_Map.prototype.keepReactorLighting2DOnTop()

Keep the darkness and glow the last things drawn, in that order.

Details

Keep the darkness and glow the last things drawn, in that order. Plugins add their own layers to the spriteset long after it is built; light is the one thing that belongs over all of it. An ordinary frame costs two comparisons.

suppressReactor3DGroundParallaxes

method source
Spriteset_Map.prototype.suppressReactor3DGroundParallaxes(hide)

Suppress reactor3 d ground parallaxes. (Same as the RPG Maker MZ method of this name.)

reactor3DGroundParallaxNames

method source
Spriteset_Map.prototype.reactor3DGroundParallaxNames()

The parallaxes this map's 3D ground was built from, by name.

keepReactor3DLightsOnTop

method source
Spriteset_Map.prototype.keepReactor3DLightsOnTop()

Keep reactor3 d lights on top. (Same as the RPG Maker MZ method of this name.)

reactor3DCompany

method source
Spriteset_Map.prototype.reactor3DCompany()

Who else a wall must not hide: the visible followers, then the nearest events that show a character, within reach of the player.

Details

Who else a wall must not hide: the visible followers, then the nearest events that show a character, within reach of the player. The cutaway takes a bounded few, so the nearest come first.

reactor3DCameraFocus

method source
Spriteset_Map.prototype.reactor3DCameraFocus()

The centre of what the map is displaying, in map coordinates.

Details

The centre of what the map is displaying, in map coordinates.

displayX is the left-hand edge, so half a screen is added to reach the middle — the point the 2D view has at its centre, which is the point the 3D camera should be looking at.

animationBaseDelay

method source
Spriteset_Map.prototype.animationBaseDelay()

Animation base delay. (Same as the RPG Maker MZ method of this name.)