じ☆ve冰风 发表于 2026-8-2 19:18:41

FG7 - Easy Parallax Map Lock

Easy Parallax Map Lock
By: FamilyGamer7​

Introduction
                        Quick and easy script snippet to lock the tile(s) and parallax background together. (Inspiration from Yanfly - Parallax Lock script)               
Click to expand...


Features
                        Locks the Parallax background with the tiles when moving on screen and you will have the ability to turn the script functionality "Off/On" during the game with a script call.               
Click to expand...


Screenshot(s)
                        - Not Needed -               
Click to expand...


Script
Spoiler: FG7 - Easy Parallax Map Lock                Ruby:       
#==============================================================================
# Title: Easy Parallax Map Lock
# Author: FamilyGamer7 (FG7)
# Version: 1.0
# Engine: RPG Maker VX Ace
# (Inspiration from Yanfly - Parallax Lock script)
#==============================================================================
# ** Change Log |
# ---------------
# 1.0 => Created script
#==============================================================================
# ** Description |
# ----------------
# Quick and easy script snippet to lock the tile(s) and parallax together.
# (Locks the Parallax background with the tiles when moving on screen)
#==============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * Feel free to modify and improve the script. Credit is still required.
# * Credit FamilyGamer7
#==============================================================================
# ** Usage |
# ----------
# * Plug & Play
#
# By default, this parallax map lock will be set as ON. Feel free to turn off
# the script functionality with the script call(s) below.
#
# - Script calls provides ability for ON/OFF functionality during game.
#
# To turn OFF parallax map lock:
# $game_system.parallax_map_lock_off = true
#
# To turn ON parallax map lock:
# $game_system.parallax_map_lock_off = false
#==============================================================================

#==============================================================================
# ** Module: FG7::Easy_Parallax_Map_Lock
#------------------------------------------------------------------------------
#This modules creates a static variable to be used within the script.
#==============================================================================

module FG7
module Easy_Parallax_Map_Lock

#==============================================================================
# -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
#==============================================================================

    # Sets the value for the $game_switch used for the parallax map lock
    Parallax_Map_Lock_Switch = 39
   
#==============================================================================
# ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
#==============================================================================

end
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# * New Method: parallax_map_lock_off (Flag to turn on/off during game)
#--------------------------------------------------------------------------
def parallax_map_lock_off=(string)
    @parallax_map_lock_off = string
    $game_switches = @parallax_map_lock_off
end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# Override Method: Calculate X Coordinate of Parallax Display Origin
#--------------------------------------------------------------------------
alias :fg7_easy_parallax_map_lock_parallax_ox :parallax_ox
def parallax_ox(bitmap)
    return @display_x * 32 if $game_switches == false
    fg7_easy_parallax_map_lock_parallax_ox(bitmap)
end
#--------------------------------------------------------------------------
# Override Method: Calculate Y Coordinate of Parallax Display Origin
#--------------------------------------------------------------------------
alias :fg7_easy_parallax_map_lock_parallax_oy :parallax_oy
def parallax_oy(bitmap)
    return @display_y * 32 if $game_switches == false
    fg7_easy_parallax_map_lock_parallax_oy(bitmap)
end
end


How to Use
                        Add this script in the script editor under in the "Materials" section and above "Main Process".
The instructions and setup for the script are held within the script header itself. No need to repeat here.               
Click to expand...


Terms of Use
                        - Free to use in non-commercial projects and commercial projects
- Feel free to modify and improve the script. Credit is still required.
- Credit FamilyGamer7               
Click to expand...




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