じ☆ve冰风 发表于 2026-7-26 08:38:02

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

Spoiler
https://www.youtube.com/embed/cycVR4BuMN4





How to Use

SpoilerDownload 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

SpoilerThis 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

Spoiler2016.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.


本贴来自国际rpgmaker官方论坛作者:biud436处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/multiple-viewports.67300/
页: [1]
查看完整版本: Multiple Viewports