Multiple Viewports


Multiple Viewports 1.2.1
By Biud436

​
Introduction
This plugin provides the multiple viewports

Features
- This plugin can only use in PIXI 4.0.0 or more.

Video



How to Use

Spoiler
Download the plugin and place it in the folder called your_project_directory/js/plugins.
Then In Plugin Manager, Select the RS_MultipleViewports plugin and add it.

Plugin Commands

Spoiler
This is a plugin command that can activate the multiple viewports. If you call this plugin command, You can be using the multiple viewports.

Code:
 MultipleViewport Enable

This can disable the multiple viewports. If you call this plugin command, You can be using original stage renderer. But, Note that any drawing object of previous view-port is not removed in memory so if you will need it, you try to call the 'MultipleViewport ClearImage ViewID' plugin command.

Code:
 MultipleViewport Disable

This is the plugin command that can set the power of the viewport shake.

Code:
 MultipleViewport StartShake shakePower

This is the plugin command that can set the end of the viewport shake.

Code:
 MultipleViewport EndShake

This is the plugin command that can set an image of certain viewport (View ID is number between 1 and 4)

Code:
 MultipleViewport Image ViewID ImageName

This is the plugin command that can delete the image of certain viewport (View ID is number between 1 and 4)

Code:
 MultipleViewport ClearImage ViewID

This is the plugin command that can set the video to certain viewport.
Note that the file type should set the WEBM(.webm)

ViewID is the number between 1 and 4.
szSrc Indicates the video name from the movies directory.
loop allows you to set with the true or false.
You can repeat the video via this value. (If you are omitted this loop value, its video will only play once)

Code:
 MultipleViewport Video viewID szSrc loop

This command moves back x seconds from current video position.

Code:
 MultipleViewport MoveBackSeconds viewID second

This command moves forward x seconds from current video position.

Code:
 MultipleViewport MoveForwardSeconds viewID second

This is the plugin command can play the video to certain viewport.

Code:
 MultipleViewport PlayVideo viewID

This is the plugin command can stop the video to certain viewport.

Code:
 MultipleViewport StopVideo viewID

This is the plugin command can pause the video to certain viewport.

Code:
 MultipleViewport PauseVideo viewID

This is the plugin command can remove the video to certain viewport.

Code:
 MultipleViewport ClearVideo viewID

This plugin command allows you to change a display position of the viewport
'viewID' is the number between 1 and 4.
If 'EventID' is same as -1, the viewport target will set as the game player. if not, it will set as certain event.

You might wonder what happens to the viewport after this command has executed.

By default, the viewport is stored the id of certain target and it is tracking available its position until before moving as the next map. if it is also not set specific target id to certain viewport, it will set as the player position. The target can belong to an instance of ViewportTarget(the object that can control display's position as target's position) and each instance will set an inner position of the viewport by using the function called $gameMap.setDisplayPos.​
Code:
 MultipleViewport Target viewID EventID

Plugins

This plugin can be downloaded in the following link.

Github RAW

Change Log

Spoiler
2016.06.13 (v1.0.0) - First Release.
2016.08.24 (v1.1.0) - Now RPG Maker MV 1.3.0 or more is supported.
2016.08.24 (v1.1.2) - Added Plugin Commands
2016.08.25 (v1.1.4) - Added the functions that sets an image of certain viewport.
2016.09.30 (v1.1.5) - Added the function that plays the video to certain viewport.
2016.10.01 (v1.1.6) - Added the rendering code that is compatible with the canvas mode.
2016.10.20 (v1.1.7) - Fixed the issue that is not working in RMMV 1.3.2
2016.10.23 (v1.1.8) - Fixed the issue that the video frame is not updated in PIXI 4.0.3
2016.11.24 (v1.1.9) - Now this can change the viewport orientation such as portrait, landscape and can also set the number of viewports.
2016.11.26 (v1.2.0) - Added certain code to remove the texture from memory.
2017.02.08 (v1.2.1) :
- Added new function that could change the inner position of certain viewport by using the function called $gameMap.setDisplayPos.
- Fixed an issue that is remaining the previous texture in certain viewport if the user sets the same thing again to certain viewport when playing the video in certain viewport.
- Converted some sources to ES6

Credit and Thanks
- Biud436

Terms of Use
Free for commercial and non-commercial use.
Looks cool that you can do that, but why? Like what would be the use in your game? I'm curious cause its a cool idea
@Wookiee420 Off the top of my head puzzles come to mind. Say you need to see water rising and lowering in another area without jumping back and forth between maps or making it guess work for the player. You have the picture show up telling you what the current water level is. Or maybe you have a riddle or puzzle that needs consent reviewing so instead of having the player run back to the same spot, you can just show the image and they can work it out without having to constantly run back and forth.  
never thought of that, thats cool
nice work friend !!! very nice work !
@Wookiee420 A Multiple Viewports plugin can appear outer landscape and inner image of specific decoration in detail. In the adventure genre game, this plugin can also give the hint to someone that might be wandering about aimlessly via the viewport image. In Addition, All Images are always maintaining the setting of the image from the viewport unless you can delete the image.
"All images are always maintaining the setting of the image from the viewport unless you can delete the image." What? That sentence is confusing to me
"All images are always maintaining the setting of the image from the viewport unless you can delete the image." What? That sentence is confusing to me



So again, If you've got a viewport configured to be image, that image will be not delete, until exiting the game, unless you directly delete that image via plugin command. and I'm so sorry for my limited knowledge of English.
ahhh i get it...dude dont trip, english is my first language and i'm not good at it 😛
Ow!


Now we can make 3DS games 😀  or local multiplayer


if i change the screen to other maps, it will run the events in this map?
Ow!


Now we can make 3DS games 😀  or local multiplayer


if i change the screen to other maps, it will run the events in this map?



It is not. If you move to other map, this plugin will redraw the RenderTexture that is copying your screen.


That's because RPG Maker MV runs the only one scene.


So this means that you can draw the only one map to your screen.
v1.15 Updated :  Added the function that plays the video to certain viewport.


v1.16 Updated : Added the rendering code that is compatible with the canvas mode.

Can you use this to have a map on one half of the screen and a menu/dialogue on the other?
Can you use this to have a map on one half of the screen and a menu/dialogue on the other?



It is impossible. I think that its render code is so complicated.
This is a VERY interesting plugin.  As somebody who is working on a game that involves spacetravel, it might be cool to have scenes that show what is going on in space at the same time that Earth stuff is going on.


Thanks for your contribution! If I end up using it, I'll post something here in the future. 
I can't think of anything you would actually use this for in a real game. Maybe a world map on half the screen for a labyrinth or zeldalike game? 
I can't think of anything you would actually use this for in a real game. Maybe a world map on half the screen for a labyrinth or zeldalike game? 

Well you can think of special puzzle like 4 people in separate areas and trying to solve one main puzzle.
Well you can think of special puzzle like 4 people in separate areas and trying to solve one main puzzle.


It is not. If you move to other map, this plugin will redraw the RenderTexture that is copying your screen.


That's because RPG Maker MV runs the only one scene.


So this means that you can draw the only one map to your screen.
Well you can think of special puzzle like 4 people in separate areas and trying to solve one main puzzle.



Not possible as Black Mamba pointed out. Seems to be too many limitations for this mod to ever be used
v1.18 Updated : There was a problem that the video frame is not updated. But now it has fixed its issue.

Original thread: https://forums.rpgmakerweb.com/threads/multiple-viewports.67300/