#============================================================================== # # Yami Engine Ace - Overlay Mapping # -- Last Updated: 2012.04.16 # -- Level: Normal # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YSE-OverlayMapping"] = true #============================================================================== # Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.04.16 - Reworked with Encrypted Game. # 2012.04.13 - Ported into Yami Engine. # #============================================================================== # Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script based on Hanzo Kimura's idea. This will automatically load map's # overlay by map ID, and a map can have more than one image per layer, so you # don't have to create two or more map just for day/night or when an event occur. # #============================================================================== # Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Create a folder in Graphics and name it Overlay. # Put all of your overlay into Graphics/Overlay. # Your overlay file will have the name: "Filename Prefix" + Map-ID + "-" + Number # which "Filename Prefix" is the one you will config below # Map-ID is your map's ID # Number is 1, 2, 3, ... using for Overlay Variables. # # Example: Graphics/Overlay/ground2-1.png # Which means this will be ground layer, for map 2, variable = 1 # # Light/Shadow must be .jpg # Parallax/Ground must be .png # #============================================================================== module YSA module OVERLAY #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Overlay Switches - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These are switches which are enable overlay layers. Turn them on to show # them in your maps. #-------------------------------------------------------------------------- # Default: ON #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- LIGHT_SWITCH = 1 # Turn on/off light layer SHADOW_SWITCH = 2 # Turn on/off shadow layer PARALLAX_SWITCH = 3 # Turn on/off parallax layer GROUND_SWITCH = 4 # Turn on/off ground layer #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Overlay Variables - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # A map can have more than one image per layer, that means you can have a # different light/shadow for day and night, or have a different ground when # an event occured. #-------------------------------------------------------------------------- # Default: 1 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- LIGHT_VARIABLE = 2 # Switch to another light SHADOW_VARIABLE = 2 # Switch to another shadow PARALLAX_VARIABLE = 1 # Switch to another parallax GROUND_VARIABLE = 1 # Switch to another ground #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Filename Prefix - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This will make this script automatic, it will check if there are layers in # overlay folder #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- LIGHT = "light" # Light layer's filename prefix SHADOW = "shadow" # Shadow layer's filename prefix PARALLAX = "par" # Parallax layer's filename prefix GROUND = "ground" # Ground layer's filename prefix #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Overlay Opacity - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This will make this script automatic, it will check if there are layers in # overlay folder #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- GROUND_OPACITY = 255 PARALLAX_OPACITY = 255 LIGHT_OPACITY = 128 SHADOW_OPACITY = 96 end #OVERLAY end # YSA #============================================================================== # Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== #============================================================================== # Cache #============================================================================== module Cache #-------------------------------------------------------------------------- # new method: overlay #-------------------------------------------------------------------------- def self.overlay(filename) begin self.load_bitmap("Graphics/Overlay/", filename) rescue self.empty_bitmap end end end # Cache #============================================================================== # DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: setup_new_game #-------------------------------------------------------------------------- class <