设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 119|回复: 0

[转载发布] ARK's Screenshot Parallax & Picture Z Manipulation

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 07:38:55 | 显示全部楼层 |阅读模式
    In advance, I ask excuses for my english. I try to sound natural, but it is not my first language, so... Anyway, there it goes...

    This script takes a Screenshot from the curret map and transforms it in a Parallax  for the next map provided it has the term "~scback" writen in its name.

    It also manipulates the Viewports for the Pictures and the Parallax, so every Map that has the term "~evOVpic" in its name will display the pictures behind the events - except the Pictures with numbers from 90 to 100: these ones will still be displayed over events for convinience.

    So, please: READ THE TERMS OF USE AND RESPECT THEM.
    The most important of them is: GIVE ME A FREE PLAYEABLE COPY OF YOUR GAME.
    And read the header's user manual, too.
    I acept donnations and make Comissioned Scripts, just send me a PM or e-mail so we can talk about.

    So long!

    Spoiler# -*- coding: utf-8 -*-
    =begin
    #======================================================================================#
    #================= ARK's Screenshot Parallax & Picture Z Manipulation =================#
    #======================================================================================#
    * Version : 1.0
    * Release Date : 26/July/2018
    * License : http://creativecommons.org/licenses/by-nc-nd/4.0/
    * Contact : leomjusto@hotmail.com
    * Terms of Use :
        - Contact me for commercial use and send me a free copy of your game. (demos and complete)
        - No real support. The script is provided as-is
        - No bug fixes, no compatibility patches
        - Preserve this header
    #======================================================================================#
    # ABOUT: This script allows the Dev to use the last map image as a Parallax,
       simulating a smooth scene background for those who like to make evented scenes
       instead of scripted ones or just don't know or don't want to script one, but
       still wants the the background to look as nice as a scripted one.

       This script also manipulates the Viewports for Pictures and Parallaxes, so you can use
       it to use pictures behind events. Every Picture with Number from 90 to 100 when this
       Script functions are active will still be displayed over events as a workarround for
       special looking scenes.

    # LIMITATIONS: When you teleport from a map to another, events go back to their original
       positions and events that were erased or exited before the telport come back when you
       come back to it. But you can use evented tricks to overcome this problem with Set Position
       commands, Game Variables and Game Switches.
    #======================================================================================#
    #HOW TO USE:

      * SCREENSHOT PARALLAX : To use a last map ScreenShot as Prallax, name the map you wanna
       use as your scene with a "~scback" anywere in its name. Normally it would automatically
       add Blur and Dim to the Screenshot when turning it into a Parallax, but you can deactivate
       those functions adding these lines to the Map Name: "~no_Blur" "~no_Dim"

      * PICTURES UNDER EVENTS : Just add "~evOVpic" to your scene map name and this map will
       change the viewports for the Pictures and the Parallax. Pictures with numbers from
       90 to 100 will still be displayed over everything else.

      * MAP NAME TAGS:

        ~scback  : Use a Screenshot from the last map as Parallax
        ~no_Blur : Deactivate the Blur effect applied to the Screenshot when truning it into Parallax.
        ~no_Dim  : Deactivate the Dim effect applied to the Screenshot when turning it into Parallax.
        ~evOVpic : Activates the Viewports manipulation so every picture with numbers from 1 to 89
                   will be displyed behind Events and Animations.
    #======================================================================================#
    #======================================================================================#
    #COMPATIBILITY:

      * Alias methods
       class Spriteset_Map
         def create_viewports
         def dispose_viewports
         def update_viewports
         def update_parallax

      * Overwriten methods
       class Game_Interpreter
         def command_201
       class Spriteset_Map
         def update_pictures
    #======================================================================================#
    #====================================END OF NOTES======================================#
    #======================================================================================#
    =end



    class Game_Interpreter
      #--------------------------------------------------------------------------
      # * Transferência do jogador
      #--------------------------------------------------------------------------
      def command_201
        return if $game_party.in_battle
        Fiber.yield while $game_player.transfer? || $game_message.visible
        if @params[0] == 0                      # Definição direta
          map_id = @params[1]
          x = @params[2]
          y = @params[3]
        else                                    # Definição por variáveis
          map_id = $game_variables[@params[1]]
          x = $game_variables[@params[2]]
          y = $game_variables[@params[3]]
        end   
        $game_system.yield_bitmap_snapshot = nil if $game_system.yield_bitmap_snapshot!=nil

         if $data_mapinfos[map_id].name =~ /~scback/
             $game_map.interpreter.wait(7) if $game_message.visible
             $game_system.yield_bitmap_snapshot = Graphics.snap_to_bitmap            
         end      
        $game_player.reserve_transfer(map_id, x, y, @params[4])
        $game_temp.fade_type = @params[5]
        Fiber.yield while $game_player.transfer?
      end
    end


    class Spriteset_Map  
      #--------------------------------------------------------------------------
      # * Criação do viewport
      #--------------------------------------------------------------------------
      alias :create_viewports_zero :create_viewports
      def create_viewports
        @viewport0 = Viewport.new
        @viewport0.z = -2
        create_viewports_zero
      end

      #--------------------------------------------------------------------------
      # * Disposição dos viewports
      #--------------------------------------------------------------------------
    alias :dispose_viewports_zero :dispose_viewports
      def dispose_viewports
        dispose_viewports_zero
        @viewport0.dispose
      end

      #--------------------------------------------------------------------------
      # * Atualização dos viewports
      #--------------------------------------------------------------------------
    alias :update_viewports_zero :update_viewports
      def update_viewports
          update_viewports_zero   
        @viewport0.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
        @viewport0.update
      end

      #--------------------------------------------------------------------------
      # * Atualização das imagens
      #--------------------------------------------------------------------------
      def update_pictures
        $game_map.screen.pictures.each do |pic|
            if $data_mapinfos[$game_map.map_id].name =~ /~evOVpic/ && pic.number>=90
                @picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport3, pic)        
                @picture_sprites[pic.number].update
            else
          @picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport2, pic)
          @picture_sprites[pic.number].update
            end
        end
      end


    alias :update_parallax_screenshot :update_parallax
    def update_parallax
    if  $data_mapinfos[$game_map.map_id].name =~ /~scback/
         return if @parallax_name == 'screenshot'  
         @viewport2.z = -1 if $data_mapinfos[$game_map.map_id].name =~ /~evOVpic/
         @parallax_name = 'screenshot'
         @parallax.bitmap.dispose if @parallax.bitmap
         source = $game_system.yield_bitmap_snapshot
         $game_system.yield_bitmap_snapshot = nil   
         bitmap = Bitmap.new(Graphics.width,Graphics.height)
    @parallax = Plane.new(@viewport0)
          bitmap.stretch_blt(bitmap.rect, source, source.rect)
          @parallax.bitmap = bitmap
          @parallax.bitmap.blur unless $data_mapinfos[$game_map.map_id].name =~ /~noBlur/
          @parallax.color.set(0, 0, 0, 40) unless $data_mapinfos[$game_map.map_id].name =~ /~noDim/
          @parallax.z = -100            
         Graphics.frame_reset
    else
        if $data_mapinfos[$game_map.map_id].name =~ /~evOVpic/
                @viewport2.z = -1
             if @parallax_name != $game_map.parallax_name
                @parallax_name = $game_map.parallax_name
                @parallax.bitmap.dispose if @parallax.bitmap
    @parallax = Plane.new(@viewport0)
                @parallax.bitmap = Cache.parallax(@parallax_name)
                Graphics.frame_reset
            end
                @parallax.ox = $game_map.parallax_ox(@parallax.bitmap)
                @parallax.oy = $game_map.parallax_oy(@parallax.bitmap)
        else
            @viewport2.z = 50
            update_parallax_screenshot
        end

    end
    end
    end






    本贴来自国际rpgmaker官方论坛作者:ArkDG处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/arks-screenshot-parallax-picture-z-manipulation.98192/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 07:55 , Processed in 0.139378 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表