Bind Pictures To Map

Lets you bind the movement of pictures to the movement of the map rather than to the camera, for what is popularly called parallax mapping. Can also be used as additional layer(s) of detail to your normal maps. You can change what “layer” a picture is drawn to, like above or below characters. It even works with looping maps!

Commercial use Free. See Terms of use page for details.
Latest version 1.0.7
Last updated 2015-11-14
Dependencies None
Discussion topic Official RPG Maker Forums
Download Download from GitHub
Print / PDF
Print Friendly

Installation and compatibility

This plugin should optimally be placed at the bottom of your plugin list.

It’s important to note that since this plugin changes some core behavior of the Sprite_Picture and Game_Picture classes it’s not unlikely that there might be incompatibilities with other plugins that also affect these classes. Please let me know in the discussion topic if you find any incompatibilities and I’ll see if there’s something I can do in my plugin to solve them. Solutions could be in the form of updates to the plugin itself or the addition of a “patch” plugin to make it compatible with other individual plugins.


General information

X and Y coordinates of pictures bound to the map

When you bind pictures to the map movement, the picture’s X and Y coordinates are relative to the top-left corner of the map, not the screen. This means that if a map is smaller than the resolution of your game and thus automatically centered with black borders around it, a picture with X and Y set to the default 0 will be moved to the top left point of your map on the screen.

Looping maps

This plugin supports looping maps, but very large looping maps might cause some performance problems and lower framerates on less powerful hardware.

It’s also important to be aware that looping maps should never be smaller in size than the resolution of your game. Not only can this cause bugs with this plugin, but it also causes bugs with MV’s engine itself.


Plugin Commands

BindPictureToMap

Plugin Command: BindPictureToMap

Plugin Command: BindPictureToMap

Important: You must use this plugin command after you’ve first shown the corresponding picture nr. using the Show Picture event command.

OPTION TYPE description Default
PictureID Number The number of the picture to bind to moving with the map rather than the “screen”.
Uses the picture id you set when using the Show Picture event command to first show the picture. Ranges from 1 to 100.
Layer (optional) Text This is the new layer to move the picture to.
See the Available Layers section for a list of the different layers you can use.
top

Below is a visual example of binding picture #1 to the below_characters layer:

Plugin Command: BindPictureToMap 1 above_characters

Plugin Command: BindPictureToMap 1 above_characters

UnbindPictureToMap

Plugin Command: UnbindPictureFromMap PictureID Layer

Important: You must use this plugin command after you’ve first shown a picture using the Show Picture event command.

option type Description Default
PictureID Number The number of the picture to unbind so that it moves with the “screen”, as default.
Uses the picture id you set when using the Show Picture event command to first show the picture. Ranges from 1 to 100.
Layer (optional) Text This is the new layer to move the picture to.
See the Available Layers section for a list of the different layers you can use.
top

Below is a visual example of unbinding picture #1 from the map and then changing its layer to the top layer in the process:

Plugin Command: UnbindPictureFromMap 1 top

Plugin Command: UnbindPictureFromMap 1 top

START_BindPicturesToMap

Plugin Command: START_BindPicturesToMap Layer

Plugin Command: START_BindPicturesToMap Layer

After this plugin command has been executed, all pictures shown afterwards using the Show Picture event command will be bound to the map and the optional layer you set.
Important: You must use this plugin command before you show the pictures you want to bind using the Show Picture event command.

option Type Description Default
Layer (optional) Text This is the layer to bind the subsequently shown pictures to.
See the Available Layers section for a list of the different layers you can use.
top

Below is an example where the START_BindPicturesToMap plugin command is used to make the subsequent two pictures bound to the below_characters layer. Additionally, the STOP_BindPicturesToMap plugin command is used before a third picture is shown, so that it is not bound to the map:

Plugin Command: START_BindPicturesToMap below_characters

Plugin Command: START_BindPicturesToMap below_characters

STOP_BindPicturesToMap

Plugin Command: STOP_BindPicturesToMap

Plugin Command: STOP_BindPicturesToMap

This plugin command is used to stop new pictures shown using the Show Picture event command from being bound to the map after the START_BindPicturesToMap plugin command has been used.
Important: Use this plugin command after you’ve used the START_BindPicturesToMap plugin command. It does not affect the singular BindPictureToMap plugin command.

This plugin command has no options.


Available Layers

Layer name Description
bottom Below all layers including the map’s scrolling parallax layer.
below_tilemap Below the tilemap / world, but above the map’s scrolling parallax layer.
below_characters Below characters, events and star tiles; above other tiles.
below_weather Below the weather layer; above shadows as well as characters, events and all tilemap layers.
top Above everything including the weather layer. The default layer for pictures.

Example of use

Example of event setting up parallax layers.

Example of event setting up parallax layers.

The above example demonstrates how you can use a simple event that has Trigger set to Parallel to show and bind two parallax pictures to respective layers. The “Erase Event” event command makes sure it doesn’t repeat itself, but if you leave the map and re-enter, it’ll be renewed and trigger again.


Changelog

VERSION CHANGES
1.0.7
  • Fixed bug with non-bound picture positions when using Origin: Center
  • Using frames for picture containers. Might improve performance.
  • Fixed error where bitmaps were drawn to larger canvases than necessary when map wasn’t looping. Should improve performance significantly on larger non-looping maps.
1.0.5 Bugfix: Problem with Show Picture in battle scenes fixed.
1.0.4 Bugfix: Looping maps when the resolution is non-standard.
1.0.3 Bugfix: Fixed decimal rounding errors from Game_Map’s display X and Y coords for non-standard resolutions. Made pictures that bind to map have their xy coords start relative to map’s start xy coords.
1.0.2 Bugfix: Savegames not working due to persistent bitmap object on Game_Picture object.
1.0.1 Looping maps supported.
1.0.0 Stable release, does not support looping maps yet.

Page last modified: November 14, 2015