Introduction
This plugin allows you to display and manage multi-layered graphics, such as character displays, scenes, animations etc. It supports plugin commands, scripting, and escape character commands in "Show Text" messages.
This is my first real RPG Maker plugin. I deliberately chose not to look at other similar existing plugins before starting mine because I wanted to see what I could accomplish on my own. I would greatly appreciate constructive feedback, especially regarding user-friendliness
create a new rpg maker project or choose an existing one.
copy everything from the demo directory into your rpg maker project directory be mindfull of what you overwrite if you copy into an existing project
make sure you dont already have a jsonconfig.json in your project
[Optional] if you want to use vscode IntelliSense also copy VsLayeredDisplay.d.ts and Vs.d.ts into your plugins directory
Additionally, if you don’t already have one, copy jsconfig.json into you js directory (not the plugin directory).
to fully use IntelliSense you also ned type files for the rpg maker core files. you can use your own or copy the types folder into your js directory.
colorTone (struct, default: {"r":0,"g":0,"b":0,"gray":0}) - Color tone configuration.
DrawBitmaps
Description: redraws the bitmaps for a display
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
ShowDisplay
Description: Shows a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
HideDisplay
Description: Hides a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
FlipDisplay
Description: Flips a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
flipped (boolean, default: false) - Whether to flip the display.
SetSmoothScaling
Description: Enables or disables smooth scaling for a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
SmoothScaling (boolean, default: false) - Enable or disable smooth scaling.
SetDisplayOpacity
Description: Sets the opacity of a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
opacity (number, default: 255) - Opacity level.
SetDisplayColorTone
Description: Sets the color tone for a display.
Arguments:
displayId (number, default: 0) - Sprite ID (0 - infinity).
colorTone (struct) - Color tone configuration.
MoveToDisplay
Description: Moves an object to a display.
Arguments:
displayId (number, default: 0) - Sprite ID.
x (number, default: 0, min: 0, decimals: 6) - X coordinate.
y (number, default: 0, min: 0, decimals: 6) - Y coordinate.
MoveDisplay
Description: Moves a display.
Arguments:
displayId (number, default: 0) - Sprite ID.
x (number, default: 0, min: 0, decimals: 6) - X coordinate.
y (number, default: 0, min: 0, decimals: 6) - Y coordinate.
SubImageMove
Description: Moves a sub image.
Arguments:
displayId (number, default: 0) - Sprite ID.
imageId (number, default: 0) - sub image ID
x (number, default: 0, min: 0, decimals: 6) - X coordinate.
y (number, default: 0, min: 0, decimals: 6) - Y coordinate.
SubImageMoveTo
Description: moves a sub image to
Arguments:
displayId (number, default: 0) - Sprite ID.
imageId (number, default: 0) - sub image ID
x (number, default: 0, min: 0, decimals: 6) - X coordinate.
y (number, default: 0, min: 0, decimals: 6) - Y coordinate.
SubImageResize
Description: resizes a sub image
Arguments:
displayId (number, default: 0) - Sprite ID.
imageId (number, default: 0) - sub image ID
width (number, default: 0, min: 0) - width
height (number, default: 0, min: 0) - height
RotateDisplay
Description: Rotates a display.
Arguments:
displayId (number, default: 0) - Sprite ID.
degrees (number) - Rotation angle in degrees.
ResizeDisplay
Description: Resizes a display.
Arguments:
displayId (number, default: 0) - Sprite ID.
w (number, default: 0, min: 0, decimals: 6) - Width.
h (number, default: 0, min: 0, decimals: 6) - Height.
SetPivot
Description: Sets the pivot point of a display.
Arguments:
displayId (number, default: 0) - Sprite ID.
x (number, default: 0, min: 0, max: 1, decimals: 6) - X pivot point.
y (number, default: 0, min: 0, max: 1, decimals: 6) - Y pivot point.
4.1.2. Show Text Commands
you can also use layere displays in show text commands through escape characters if enabled the escaped character can be selection in the plugin configuration, default is B paramters ar marked with <>, [] arguments are optional
<color-tone> red:green:blue:grey color tone of the display
examples:
\B[0,my-config,0,0:body:1:face] select display 0, ensure my-config, set image 0 to body and 1 to face
\B[0,my-config,0,0:body:2
,true] select display 0, ensure my-config, set image 0 to body and 2 to beard, set flip to true
\B[1,my-config,0,2
,,120] select display 1, ensure my-config, set image 2 to beard, set opacity to 120
\B[1,my-config,0,2
,false,210,10:0:0:0] select display 1, ensure my-config, set image 2 to beard,set flip to false set opacity to 210 , set color tone
\B[0,,,,,10:0:0:0] select display 0, set color tone
\B[3,,,,155] select display 3, set opacity to 155
4.2 Plugin Development & Scripting
for developer infos look at the typescript files (.d.ts) or the included custom-layered-display plugin
6. How does the plugin work
the plugin creates two new DisplayObject (VsMultiImageContainer and VsLayeredDisplayContainer) which handle all the image operations. depending of your configuration these Objects gets inserted into every Scene or Message Window. For every new Display a new bitmap gets created (the same size as the main image) on which the main image and all sub images gets drawn to. These bitmap can now with the help of the plugin commands be changed, sized, moved etc on the scene.
7. Changes to the core script
here you can look for possible conflicts with other plugins which change the same files
rmmz_windows.js
Window_Message
updatePlacement
method override, orignal gets called
method gets overidden to update the VsMultiImageContainer position and size to fit the message window
_createAllParts
method override, orignal gets called
add an instance of VsMultiImageContainer to the window
_createContainer
method override, orignal gets called
add an instance of VsMultiImageContainer to the window
rmmz_managers.js
DataManager
_databaseFiles
entry added to the list
VsLayeredDisplayJson.json get added to the loading list of the DataManager
method override, orignal gets called
update the VsLayeredDisplayConfig from the json file
rmmz_sprites.js
Spriteset_Base
createPictures method override, orignal gets called
add an instance of VsMultiImageContainer to the scene
8. Updates
Spoiler: Update History
Spoiler: Version 1.2.0
Add Plugin Paramter: DrawInUpdate
reworked redrawing of bitmaps to prevent not needed redraws
Spoiler: Version 1.1.0[quote]
Add Methods: SubImageMove,SubImageMoveTo and SubImageResize
[/quote]9. Troubleshooting
for more information go to Github or ask me directly
10. Disclaimer
stable diffusion was used to create the images for the example project.
11. License
Terms and Credits
VsLayeredDisplay is marked with CC0 1.0 Universal. To view a copy of this license, visit https://creativecommons.org/publicdomain/zero/1.0/
This plugin can be used in any project, commercial or otherwise. no credit needed.