Started by ShadowSaber, April 19, 2011, 06:48:25 am
#=======================================================================# ** Additional Bitmap Methods#-----------------------------------------------------------------------# By Untra# 5/5/10# v0.5#======================================================================= #--------------------------------------------------------------------- # * Invert # WARNING: Inverting colors is especially process consuming, and # with frequent use can lag a game indefinitely. Use sparringly. # NOTE: calling an invert color method a second time will bring its # colors back to normal, assuming you didn't change its colors # while in negative. #--------------------------------------------------------------------- class Bitmap def invert for w in 0..(width - 1) for h in 0..(height - 1) color = get_pixel(w, h) r = 255 - color.red g = 255 - color.green b = 255 - color.blue a = color.alpha set_pixel(w, h, Color.new(r, g, b, a)) if a > 0 end end return self endend#=======================================================================# ** Additional Bitmap Methods Implemented#=======================================================================class Sprite_Character alias invert_update update def update invert_update if @character.inverting self.bitmap.invert @character.invert end endendclass Game_Character attr_reader :inverting alias invert_init initialize def initialize invert_init @inverting = false end def invert @inverting = !@inverting endend