Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Status Menu Backgrounds
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.0
- # * Updated: 07/12/2016
- # * Requires: --------
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (07/12/2016)
- # - Initial release.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This is a simple script for adding custom backgrounds for your status menu.
- # * You can make unlimited amount of backgrounds.
- # * Set up static and/or scrolling backgrounds.
- # * Can be used to remove the default mapshot background as well.
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this script between Materials and Main!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities, but there is a high chance of this not working
- # with some other scripts dealing with the visuals of the status menu.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthStatusBacks"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module StatBack
- #-----------------------------------------------------------------------------
- # Image Folder Settings:
- #-----------------------------------------------------------------------------
- # Set up the folder used for the background images in the status menu here.
- #-----------------------------------------------------------------------------
- ImgFolder = "Graphics/Pictures/"
- #-----------------------------------------------------------------------------
- # Background Settings:
- #-----------------------------------------------------------------------------
- # This is the place to setup your background images for the status menu.
- #
- # You can either make scrolling images, static images, or combine them both!
- # If you have set a :scroll setting for the background, it will be a scrolling
- # background, if you omit that setting, it will be a static one!
- # You can make as many backgrounds as you want!
- #
- # Format:
- #
- # key => {
- # :img => "file name",
- # :pos => [x,y], # Only for static backgrounds!
- # :opa => value,
- # :z => value,
- # :scroll => [x_scroll,y_scroll], # Only for scrolling backgrounds!
- # },
- #
- # key => {
- # This is the key for the background. You can set this to anything you want,
- # strings, numbers, symbols, arrays of data, and so on. The only thing you
- # need to take care is that there can be no duplicate keys in the settings!
- #
- # :img => "file name",
- # The image used for the background.
- # All images must be in the folder you have set up in the 'ImgFolder'
- # setting above!
- #
- # :pos => [x,y],
- # The X and Y position of the background.
- # This only needs to be set for static backgrounds!
- #
- # :opa => value,
- # The opacity value for the background image. Valid values: 0 - 255.
- #
- # :z => value,
- # The Z value for the background.
- #
- # :scroll => [x_scroll,y_scroll],
- # The scrolling speed of the background.
- # The higher the values, the quicker it will scroll!
- # The 1st value is the scrolling on the X axis, the 2nd is for the Y axis!
- # Only add this setting if you want the background to be a scrolling one!
- #
- # NOTE:
- # If you use the key :mapback, the current map screenshot will be used
- # as a background, like in the default menus.
- # So, that key is reserved for that!
- #-----------------------------------------------------------------------------
- Backs = {
- :mapback => { # This is the default mapshot background!
- :pos => [0,0], :opa => 100, :z => 0,
- },
- #~ :custom1 => {
- #~ :img => "WorldMap", :pos => [0,0], :opa => 100, :z => 0, :scroll => [1,1],
- #~ },
- #~ :custom2 => {
- #~ :img => "compass", :pos => [640-140,10], :opa => 150, :z => 330,
- #~ },
- # Add more background settings here!
- }
- end
- #===============================================================================
- # End of settings! O.o
- #===============================================================================
- module Cache
- def self.custom_imgs(img,folder)
- load_bitmap(folder,img)
- end
- end
- class Scene_Status < Scene_MenuBase
- alias add_back8861 start
- def start
- add_back8861
- init_backs
- end
- def init_backs
- @backs = {}
- folder = StatBack::ImgFolder
- StatBack::Backs.each do |sym,data|
- @backs[sym] = data[:scroll].nil? ? Sprite.new : Plane.new
- if sym == :mapback
- @backs[sym].bitmap = SceneManager.background_bitmap.clone
- else
- @backs[sym].bitmap = Cache.custom_imgs(data[:img],folder)
- end
- if @backs[sym].is_a?(Sprite)
- @backs[sym].x = data[:pos][0]
- @backs[sym].y = data[:pos][1]
- end
- @backs[sym].opacity = data[:opa]
- @backs[sym].z = data[:z]
- end
- end
- def create_background
- # Removed!
- end
- def update
- super
- update_scrolling_backs
- end
- def update_scrolling_backs
- @backs.each do |sym,sp|
- next unless sp.is_a?(Plane)
- sp.ox += StatBack::Backs[sym][:scroll][0]
- sp.oy += StatBack::Backs[sym][:scroll][1]
- end
- end
- alias bcontr7726 dispose_background
- def dispose_background # Left in for error prevention.
- return if @background_sprite.nil? || @background_sprite.disposed?
- bcontr7726
- end
- def dispose_backs
- @backs.each_value {|sp| sp.bitmap.dispose; sp.dispose}
- end
- alias disp_backs0191 dispose_all_windows
- def dispose_all_windows
- disp_backs0191
- dispose_backs
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement