N.A.S.T.Y Replace Window with Picture

● ARCHIVED · READ-ONLY
Started by Nelderson 8 posts View original ↗
  1. N.A.S.T.Y. Replace Window with Picture
    By: Nelderson


    Introduction
    This script uses pictures instead of windows you specify.  While this looks very simple, for the Photoshop nerds this will be invaluable. 

    Features
    - Have a picture instead of the default window.
    - Use pictures on only the windows you want

    - Should be compatible with most custom scripts and windows

    Screenshots

    Spoiler
    ilwv9y.png

    Same pictures, with opacity taken down in Photoshop

    8ysx0x.png

    How to Use

    -Configure the PICWINDOW Hash. It should work with not only default windows, but custom windows from other scripts as well.

     

    -If you want to know how big your window is to make a picture, the best way is to look at the initialize method on each window class.  It is usually in the format (x, y, width, height).  So the picture you need to make should be the same width and height.  Or another way is to find out the dimensions is to take a screenshot of your game window.  And then with photoshop, or something similar, select the box and look at how big the dimensions are in the select window.

     

     

    Demo
    I'll make one if you guys want one!

    Script

    Spoiler
    #===============================================================================#           N.A.S.T.Y. Replace Window with Picture#               Nelderson's Awesome Scripts To You# By: Nelderson# Made On: 3/11/2015# Last Updated: 3/12/2015#===============================================================================# Update History:# - Version 0.5 - Initial Release - Technically BETA/Tesing Stage# - Version 1.0 - Fixed issues with the Message window and added#                 feature to change picture to a window with a script call#===============================================================================# *Notes:#  -This script uses pictures instead of windows you specify.#===============================================================================# Credits:# -Nelderson#===============================================================================#  Instructions:##  -Configure the PICWINDOW Hash below. It should work with not only #   default windows, but custom windows from other scripts as well.##  -If you want to know how big your window is to make a picture,#   the best way is to look at the initialize method on each window#   class.  It is usually in the format (x, y, width, height).#   So the picture you need to make should be the same width and height.##  -You can change the pic of the window you want by using the script call:#     change_nelwinpic(window, "pic") #        Where window is the class and pic is the name in the pictures folder.#        Ex. change_nelwinpic(Window_Gold, "Gold")#===============================================================================# Take the Window Class name => Name of the "picture" in the Pictures folder # Example:# Window_Gold => "Gold",module NEL    PICWINDOW ={   # <=== Do Not Remove      Window_Message => "BlueMessage",  Window_Gold => "BlueGold",  Window_MenuStatus => "BlueStatus",  Window_MenuCommand => "BlueCommand",  Window_NameInput => "pic4",  Window_NameEdit => "blah",          }# <=== Do Not Removeend#==============================================================================##                            END OF CUSTOMIZATION                              ##==============================================================================#class Game_System  attr_accessor :nelpicwindow  alias nel_winpic_sysinit initialize  def initialize    nel_winpic_sysinit    @nelpicwindow = {}    for i in NEL::pICWINDOW      @nelpicwindow[i[0]] = i[1]    end  endendclass Window_Base < Window  attr_accessor :nelwinpic  alias nel_winpic_scrpt_init initialize  def initialize(*args)    nel_winpic_scrpt_init(*args)    create_nelpicture  end    def create_nelpicture    for i in $game_system.nelpicwindow    #Stupid Gold Window....    next if SceneManager.scene_is?(Scene_Map) && self.instance_of?(Window_Gold)    next if SceneManager.scene_is?(Scene_Battle) && self.instance_of?(Window_Gold)    next if i[1] == nil #In case in game is changed.  Goes back to default      if self.instance_of?(i[0]) ###Where all the magic happens!###        @nelwinpic = ::Sprite.new(self.viewport)        @nelwinpic.visible = false        @nelwinpic.bitmap = Cache.picture(i[1])        @nelwinpic.x = self.x        @nelwinpic.y = self.y        @nelwinpic.opacity = self.opacity        self.opacity = 0      end    end  end    alias nel_winpic_scrpt_dispose dispose  def dispose    if @nelwinpic != nil      @nelwinpic.bitmap.dispose      @nelwinpic = nil    end    nel_winpic_scrpt_dispose  end    alias nel_winpic_srpt_update update  def update    nel_winpic_srpt_update    if @nelwinpic != nil      @nelwinpic.x = self.x      @nelwinpic.y = self.y      @nelwinpic.viewport = self.viewport      @nelwinpic.visible = self.visible      if self.instance_of?(Window_Message) && $game_system.nelpicwindow[Window_Message] != nil        @nelwinpic.visible = $game_message.visible        self.opacity = 0      end    end  endend  class Game_Interpreter  def change_nelwinpic(window, pic)    $game_system.nelpicwindow[window] = pic    if SceneManager.scene_is?(Scene_Map)       SceneManager.goto(Scene_Map) if window == Window_Message    end  endend

    FAQ

    Q: What does N.A.S.T.Y. stand for?
    A: Nelderson's Awesome Scripts To You!

    Credit and Thanks
    - Nelderson

    Terms of Use: 

    Free to use for non-commercial use.  Any commercial use is fine as long as you credit and throw me a copy of your completed game if it ever gets finished  :)
  2. Really;this is a treasure for PS maniacs. Thanks.
  3. This looks like it will be invaluable.  What are your terms of use?
  4. Terms of Use: 

    Free to use for non-commercial use.  Any commercial use is fine as long as you credit and throw me a copy of your completed game if it ever gets finished :)
  5. Thank you. Duly noted.
  6. nasty3.png

    OMFG You always could see right into my mind a make the exact script I was needing!!! <3 your mad skills still my old friend!!
  7. Version 1.0 Update:  Now includes a script call to change any window.  You use this before a scene is called, and the pic will change accordingly.
  8. Fixed the script format bcz I'm bored
    Spoiler
    Code:
    #===============================================================================
    #           N.A.S.T.Y. Replace Window with Picture
    #               Nelderson's Awesome Scripts To You
    # By: Nelderson
    # Made On: 3/11/2015
    # Last Updated: 3/12/2015
    #===============================================================================
    # Update History:
    # - Version 0.5 - Initial Release - Technically BETA/Tesing Stage
    # - Version 1.0 - Fixed issues with the Message window and added
    #                 feature to change picture to a window with a script call
    #===============================================================================
    # *Notes:
    #  -This script uses pictures instead of windows you specify.
    #===============================================================================
    # Credits:
    # -Nelderson
    #===============================================================================
    #  Instructions:
    #
    #  -Configure the PICWINDOW Hash below. It should work with not only 
    #   default windows, but custom windows from other scripts as well.
    #
    #  -If you want to know how big your window is to make a picture,
    #   the best way is to look at the initialize method on each window
    #   class.  It is usually in the format (x, y, width, height).
    #   So the picture you need to make should be the same width and height.
    #
    #  -You can change the pic of the window you want by using the script call:
    #     change_nelwinpic(window, "pic") 
    #        Where window is the class and pic is the name in the pictures folder.
    #        Ex. change_nelwinpic(Window_Gold, "Gold")
    #===============================================================================
    # Take the Window Class name => Name of the "picture" in the Pictures folder 
    # Example:
    # Window_Gold => "Gold",
    
    module NEL    
      PICWINDOW ={   # <=== Do Not Remove      
        Window_Message => "BlueMessage",  
        Window_Gold => "BlueGold",  
        Window_MenuStatus => "BlueStatus",  
        Window_MenuCommand => "BlueCommand",  
        Window_NameInput => "pic4",  
        Window_NameEdit => "blah",
      } # <=== Do Not Remove
    end
    
    #==============================================================================
    #
    #                            END OF CUSTOMIZATION                              
    #
    #==============================================================================
    class Game_System  
      attr_accessor :nelpicwindow  
      
      alias nel_winpic_sysinit initialize  
      def initialize    
        nel_winpic_sysinit    
        @nelpicwindow = {}    
        for i in NEL::PICWINDOW      
          @nelpicwindow[i[0]] = i[1]    
        end  
      end
    end
    
    class Window_Base < Window  
      attr_accessor :nelwinpic  
      
      alias nel_winpic_scrpt_init initialize  
      def initialize(*args)    
        nel_winpic_scrpt_init(*args)    
        create_nelpicture  
      end    
      
      def create_nelpicture    
        for i in $game_system.nelpicwindow    #Stupid Gold Window....    
          next if SceneManager.scene_is?(Scene_Map) && 
            self.instance_of?(Window_Gold)    
          next if SceneManager.scene_is?(Scene_Battle) && 
            self.instance_of?(Window_Gold)    
          next if i[1] == nil #In case in game is changed.  Goes back to default      
          if self.instance_of?(i[0]) 
            ###Where all the magic happens!###        
            @nelwinpic = ::Sprite.new(self.viewport)        
            @nelwinpic.visible = false        
            @nelwinpic.bitmap = Cache.picture(i[1])        
            @nelwinpic.x = self.x        
            @nelwinpic.y = self.y        
            @nelwinpic.opacity = self.opacity        
            self.opacity = 0      
          end    
        end  
      end
      
      alias nel_winpic_scrpt_dispose dispose  
      def dispose    
        if @nelwinpic != nil      
          @nelwinpic.bitmap.dispose      
          @nelwinpic = nil    
        end    
        nel_winpic_scrpt_dispose  
      end    
      
      alias nel_winpic_srpt_update update  
      def update    
        nel_winpic_srpt_update    
        if @nelwinpic != nil      
          @nelwinpic.x = self.x      
          @nelwinpic.y = self.y      
          @nelwinpic.viewport = self.viewport      
          @nelwinpic.visible = self.visible      
          if self.instance_of?(Window_Message) && 
            $game_system.nelpicwindow[Window_Message] != nil        
            @nelwinpic.visible = $game_message.visible        
            self.opacity = 0      
          end    
        end  
      end
    end  
    
    class Game_Interpreter  
      def change_nelwinpic(window, pic)    
        $game_system.nelpicwindow[window] = pic    
        if SceneManager.scene_is?(Scene_Map)       
          SceneManager.goto(Scene_Map) if window == Window_Message    
        end  
      end
    end