Class in reactor_media_surfaces.js

MediaSurfaceManager

29 functions in 5 groups · hide internal

The main menu, drawn by Scenes and Windows.

Familiar territory. MediaSurfaceManager 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 2

constructor() Sets up a new instance.
createOwner() Creates the owner.

Checks (True / False) 3

isCurrent() Whether it is current.
hasActiveMapSpriteset() Whether it has the active map spriteset.
isWaiting() Whether it is waiting.

Actions 6

leaveVideo() False while other surfaces still show the video (the leaver must not stop it).
releaseThreeTexture() Releases the three texture.
releaseWaiters() Releases the waiters.
show() Show.
stop() Stop.
removeForMapSetup() Removes the for map setup.

Updating & Drawing 1

updateSpriteset() Runs twice a frame: before the spriteset updates, so this frame's surfaces exist and are placed when the 3D p…

Other 17

videoShareKey() What must match for two surfaces to show one video: muted, the same file, loop and speed.
joinVideo() A playing video this surface can show instead of opening its own, or null.
shareVideo() Offer a freshly opened video to later surfaces that play it the same way.
sharedThreeTexture() One three texture per shared video: a new frame is uploaded once, not once per screen.
store() Store.
descriptor() Descriptor.
waitKey() Wait key.
armWait() Arm wait.
retryPendingPlayback() Retry pending playback.
seedMapSurfaces() Seed map surfaces.
transform() Transform.
ended() Ended.
failed() Failed.
storedDescriptor() A stored descriptor has already passed the command parser.
allStandStill() Whether every surface stands on the 3D map itself: not on the screen, a 2D map that scrolls, an event or a mo…
budgetVideos() Budget videos.
teardownRuntime() Teardown runtime.

Setup & Creation

constructor

constructor source
new MediaSurfaceManager()

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

createOwner

method source
MediaSurfaceManager.prototype.createOwner(descriptor)

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

Checks (True / False)

isCurrent

method source
MediaSurfaceManager.prototype.isCurrent(id, generation)

Whether it is current. (Same as the RPG Maker MZ method of this name.)

hasActiveMapSpriteset

method source
MediaSurfaceManager.prototype.hasActiveMapSpriteset()

Whether it has the active map spriteset. (Same as the RPG Maker MZ method of this name.)

isWaiting

method source
MediaSurfaceManager.prototype.isWaiting(interpreter)

Whether it is waiting. (Same as the RPG Maker MZ method of this name.)

Actions

leaveVideo

method source
MediaSurfaceManager.prototype.leaveVideo(entry, owner)

False while other surfaces still show the video (the leaver must not stop it).

releaseThreeTexture

method source
MediaSurfaceManager.prototype.releaseThreeTexture(entry, owner)

Releases the three texture. (Same as the RPG Maker MZ method of this name.)

releaseWaiters

method source
MediaSurfaceManager.prototype.releaseWaiters(id, generation)

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

show

method source
MediaSurfaceManager.prototype.show(raw, interpreter)

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

stop

method source
MediaSurfaceManager.prototype.stop(raw)

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

removeForMapSetup

method source
MediaSurfaceManager.prototype.removeForMapSetup(map)

Removes the for map setup. (Same as the RPG Maker MZ method of this name.)

Updating & Drawing

updateSpriteset

method source
MediaSurfaceManager.prototype.updateSpriteset(spriteset, settled)

Runs twice a frame: before the spriteset updates, so this frame's surfaces exist and are placed when the 3D pass draws them, and after (settled), for the ones the frame started or changed and for the flat ones PIXI draws later.

Details

Runs twice a frame: before the spriteset updates, so this frame's surfaces exist and are placed when the 3D pass draws them, and after (settled), for the ones the frame started or changed and for the flat ones PIXI draws later. A 3D plane the pass has already drawn is not placed a second time: nothing draws or reads it again before the next frame's first pass places it afresh from the same state. secondPlacement.enabled = false places it anyway.

Other

videoShareKey

method source
MediaSurfaceManager.prototype.videoShareKey(descriptor)

What must match for two surfaces to show one video: muted, the same file, loop and speed.

joinVideo

method source
MediaSurfaceManager.prototype.joinVideo(owner)

A playing video this surface can show instead of opening its own, or null.

shareVideo

method source
MediaSurfaceManager.prototype.shareVideo(owner, video)

Offer a freshly opened video to later surfaces that play it the same way.

sharedThreeTexture

method source
MediaSurfaceManager.prototype.sharedThreeTexture(entry, owner)

One three texture per shared video: a new frame is uploaded once, not once per screen.

store

method source
MediaSurfaceManager.prototype.store(map, create)

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

descriptor

method source
MediaSurfaceManager.prototype.descriptor(id)

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

waitKey

method source
MediaSurfaceManager.prototype.waitKey(id, generation)

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

armWait

method source
MediaSurfaceManager.prototype.armWait(interpreter, descriptor)

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

retryPendingPlayback

method source
MediaSurfaceManager.prototype.retryPendingPlayback()

Retry pending playback. (Same as the RPG Maker MZ method of this name.)

seedMapSurfaces

method source
MediaSurfaceManager.prototype.seedMapSurfaces(mapData)

Seed map surfaces. (Same as the RPG Maker MZ method of this name.)

transform

method source
MediaSurfaceManager.prototype.transform(raw, interpreter)

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

ended

method source
MediaSurfaceManager.prototype.ended(id, generation)

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

failed

method source
MediaSurfaceManager.prototype.failed(id, generation, error)

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

storedDescriptor

method source
MediaSurfaceManager.prototype.storedDescriptor(raw)

A stored descriptor has already passed the command parser.

Details

A stored descriptor has already passed the command parser. Keep its exact field snapshot so ordinary playback avoids rebuilding all of the alias lists, corners and anchor arrays. In-place edits still pass through the full parser, including malformed restored data.

The spriteset asks twice a tick (before and after its own update); a record that matched earlier in the same frame is not walked again.

allStandStill

method source
MediaSurfaceManager.prototype.allStandStill()

Whether every surface stands on the 3D map itself: not on the screen, a 2D map that scrolls, an event or a model's anchor.

budgetVideos

method source
MediaSurfaceManager.prototype.budgetVideos()

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

teardownRuntime

method source
MediaSurfaceManager.prototype.teardownRuntime(reason)

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