Save-Point
Change the hue of pictures - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+----- Thread: Change the hue of pictures (/thread-6776.html)



Change the hue of pictures - Sheol - 11-29-2005

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Here are some example of what do:

Hue in icons:
Code:
my_icon = RPG::Cache.icon("001-Weapon01",60)

Change the skin for a window:
Code:
self.windowskin = RPG::Cache.windowskin("yellow_skin",-50)

Change the skin for all windows:
Code:
$game_system.windowskin_name = "001-Blue01"
        $game_system.windowskin_hue = 50

Paste this below the Main section:
Code:
#-----------------------------------------------------------------
module RPG
#-----------------------------------------------------------------
  module Cache
#-----------------------------------------------------------------
    def self.picture(filename,hue=0)
      self.load_bitmap("Graphics/Pictures/",filename,hue)
    end
#-----------------------------------------------------------------
    def self.icon(filename,hue=0)
      self.load_bitmap("Graphics/Icons/",filename,hue)
    end
#-----------------------------------------------------------------
    def self.windowskin(filename,hue=0)
      self.load_bitmap("Graphics/Windowskins/",filename,hue)
    end
#-----------------------------------------------------------------
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
class Window_Base < Window
#-----------------------------------------------------------------
  def initialize(x,y,width,height)
    super()
    @windowskin_name = $game_system.windowskin_name
    @windowskin_hue = $game_system.windowskin_hue
    self.windowskin = RPG::Cache.windowskin(@windowskin_name,@windowskin_hue)
    self.x = x
    self.y = y
    self.width = width
    self.height = height
    self.z = 100
  end
#-----------------------------------------------------------------
  def update
    super
    if $game_system.windowskin_name != @windowskin_name or
     $game_system.windowskin_hue != @windowskin_hue
      @windowskin_name = $game_system.windowskin_name
      @windowskin_hue = $game_system.windowskin_hue
      self.windowskin = RPG::Cache.windowskin(@windowskin_name,@windowskin_hue)
    end
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
class Game_System
#-----------------------------------------------------------------
  attr_accessor :windowskin_hue
#-----------------------------------------------------------------
  alias sk_windowskinhue_init initialize
  def initialize
    sk_windowskinhue_init
    @windowskin_hue = 0
  end
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------