Hello everyone,
I need help how to invert character graphic in map when game is playing
I found the script, but I don't know how to use it
---------edit : resolved-----------
This is a very simple implementation of just the invert method.
#=======================================================================
# ** 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
end
end
#=======================================================================
# ** Additional Bitmap Methods Implemented
#=======================================================================
class Sprite_Character
alias invert_update update
def update
invert_update
if @character.inverting
self.bitmap.invert
@character.invert
end
end
end
class Game_Character
attr_reader :inverting
alias invert_init initialize
def initialize
invert_init
@inverting = false
end
def invert
@inverting = !@inverting
end
end
To change the player, call
$game_player.invertTo change an event, call
event = get_character(0)
event.invert
DELETED POST
I totally just misread what this did...
thanks brewmeister, now i understand how to use it ^^