視差マッピング、フォグなどのグラフィックレイヤを作成するプラグイン – GALV_LayerGraphics.js
- タイトル
- Create graphic layers for parallax mapping, fog, etc
- 作者名
- Galv - galvs-scripts.com様
- ヘルプ
- Galv's Layer Graphics
----------------------------------------------------------------------------
Before you start, you will need to create a layers folder in your project.
/img/layers/
This is where all your layer images will be taken from.
Each map can have many graphic layers, but be aware that the more you have,
the more chance the game could lag (especially on slow computers or mobile
devices).
When a layer is made, it is stored, so you can set layers for maps before
a player enters them. The layers are created when the map is created, so
for layer commands created on the same map, 'REFRESH LAYERS' plugin command
can be used to force the layers to create during play.
Below are commands to be used in the "Plugin Command" event command.
NOTE: This is different to the "Script" event command.
----------------------------------------------------------------------------
Plugin Commands (Quick)
----------------------------------------------------------------------------
LAYER MAPID ID GRAPHIC XSPEED YSPEED OPACITY Z XSHIFT YSHIFT BLEND
LAYER_S MAPID ID GRAPHIC X Y OPACITY Z BLEND
LAYER REMOVE MAPID ID
LAYER REFRESH
----------------------------------------------------------------------------
Plugin Commands (Detailed)
----------------------------------------------------------------------------
To create or change a layer graphic, the following plugin command is used:
LAYER MAPID ID GRAPHIC XSPEED YSPEED OPACITY Z XSHIFT YSHIFT BLEND
Each property is separated by a space and you will exchange the property
names above with values.
EXPLANATION OF PROPERTIES:
LAYER - do not change this, it is the keyword for the plugin.
MAPID - the id of the map you are creating the layer for
ID - the id of the layer itself. If you want to change or remove
- an existing layer, you refer to it by it's id.
GRAPHIC - The filename of the image found in /img/layers/
XSPEED - The speed of the horizontal movement. Negatives to go left
YSPEED - The speed of the vertical movement. Negatives to go up
OPACITY - Transparency of the image (0 - 255)
Z - What priority the image has. 0 = ground, 5 = above all chars
XSHIFT - Horizonal movement shift that differs from player movement
YSHIFT - Vertical movement shift that differs from player movement
- Make XSHIFT and YSHIFT = 0 to move with map
BLEND - Blend mode (0 = normal, 1 = add, 2 = multiply, 3 = screen)
-NOTE RPG Maker MV version 1.1 mutliply isn't supported
Example:
LAYER 12 1 clouds 1 0 155 5 0 0 0
This will create/change layer 1 on map 12. It will make it use "clouds.png"
as the image that will scroll right, be partially transparent and above all
Using Variables
You can use a variable for any property (except 'GRAPHIC') in the plugin
if you put a "v" before the property. The number after will be variable id.
Example:
LAYER 12 1 clouds 1 0 v1 5 0 0 0
This is the same example as above, but will use the value of variable 1
for the opacity of the layer. This only changes the setting when called,
changing the variable again without calling this plugin command again will
not change the layer.
----------------------------------------------------------------------------
Alternatively, a static sprite layer can be created. These layers will not
tile/loop and are stuck to the map, better used for parallax mapping:
LAYER_S MAPID ID GRAPHIC X Y OPACITY Z BLEND XANCHOR YANCHOR CHAR ROTATE
Each property is separated by a space and you will exchange the property
names above with values.
EXPLANATION OF PROPERTIES:
LAYER_S - do not change this, it is the keyword for the plugin.
MAPID - the id of the map you are creating the layer for
ID - the id of the layer itself. If you want to change or remove
- an existing layer, you refer to it by it's id.
GRAPHIC - The filename of the image found in /img/layers/
X - The X position of the static layer image on the map.
Y - The Y position of the static layer image on the map.
OPACITY - Transparency of the image (0 - 255)
Z - What priority the image has. 0 = ground, 5 = above all chars
BLEND - Blend mode (0 = normal, 1 = add, 2 = multiply, 3 = screen)
-NOTE RPG Maker MV version 1.1 mutliply isn't supported
XANCHOR - 0 left, 0.5 middle, 1 right - the part of the image that
- is set to the X position porperty above.
YANCHOR - 0 left, 0.5 middle, 1 right - the part of the image that
- is set to the Y position porperty above.
CHAR - 0 for none, -1 for player, above 0 for a specific event id
ROTATE - 0 for no, 1 for yes, to rotate the sprite depending on the
- direction the specified CHAR is facing. Default graphic
- should be facing down. This doesn't work if no CHAR is set
Example:
LAYER_S 6 2 town 0 0 255 0 0
This will create/change layer 2 on map 6. It will make it use "town.png"
as the image that will stick with the map. The X and Y are 0's which will
be common for most parallax mapping. Z is 0 to appear under the player.
----------------------------------------------------------------------------
LAYER REMOVE MAPID ID - Remove a layer from a map
Example:
LAYER REMOVE 12 1 - Removes layer 1 from map 12
----------------------------------------------------------------------------
LAYER REFRESH - For creating new layers on the same map as the
- plugin command. Do this command if creating
- NEW layers on the map. It is not required for
- changing existing layers
----------------------------------------------------------------------------
----------------------------------------------------------------------------
MAP NOTES
----------------------------------------------------------------------------
In addition to using the plugin calls, you can setup layers on each map in
the NOTE section of the map settings. Do this in the same way as the plugin
call except do not add the map ID.
LAYER ID GRAPHIC XSPEED YSPEED OPACITY Z XSHIFT YSHIFT BLEND
LAYER_S ID GRAPHIC X Y OPACITY Z BLEND XANCHOR YANCHOR CHAR ROTATE
These layers can be changed as normal with plugin commands.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
SCRIPT STUFF
----------------------------------------------------------------------------
For advanced users only. Layer properties can be accessed via script:
$gameMap.layerSettings[mapId][layerId].property
"property" being the above properites in lowercase.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
SCRIPT CALL - BATTLE LAYERS
----------------------------------------------------------------------------
Galv.LG.bLayer(id,'graphic',xspeed,yspeed,opacity,z,blend);
Battle layers are controlled with this script call. They don't use the
Plugin Command but the values are the same as the plugin commands above
(without the map ID). Once set, battle layers last for every combat after
until they are changed again.
BATTLE Z LEVEL - works slightly different. Cannot use decimals.
0 - behind all
1 - between battleback 1 and 2
2 - over battlebacks but under characters
3 - over all characters
To remove a layer simply use the same call with only the id.
For example:
Galv.LG.bLayer(id);
---------------------------------------------------------------------------- - パラメータ
-
param Tile Size desc The width/height of your tiles if you changed it with another plugin. default 48 - ライセンス表記
- Terms of Use
https://galvs-scripts.com/terms-of-use/
紹介ページ https://galvs-scripts.com/category/rmmv-plugins/mv-audiovisual-effects/#post-1419