starycloudstar
Member
How were you able to recolor sprites????????
starycloudstar":bm9sbhs6 said:How were you able to recolor sprites????????
sublimepwns":29mo04km said:ill do testing if you can help me out with a couple scripts and 2 sprites
#============================================================================
# ** Passability Tool
#----------------------------------------------------------------------------
# Rataime
# Version 1.00
# 22/04/2007 (2007-04-22)
#============================================================================
=begin
#------------------------------------------------------------------------------
# * SDK Log Script and Check requirements
#------------------------------------------------------------------------------
SDK.log('Passability_Tool', 'rataime', 1.00, '04.22.2007')
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Passability_Tool')
#==============================================================================
# ** Sprite_Passability_Map_Rataime
#------------------------------------------------------------------------------
# This sprite class is used to display the picture representing the passability
# of the map's tiles
#==============================================================================
class Sprite_Passability_Map_Rataime < Sprite
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
@base_bitmap = Bitmap.new($game_map.width * 32, $game_map.height * 32)
@counter = 0
@update_every_n_frame = 10
green = Color.new(0,255,0,100)
dark_red = Color.new(130,0,0,150)
red = Color.new(255,0,0,140)
for x in 0..$game_map.width-1
for y in 0..$game_map.height-1
if !$game_map.passable?(x,y,0)
@base_bitmap.fill_rect(x*32, y*32, 32, 32, red)
else
#self.bitmap.fill_rect(x*32, y*32, 32, 32, green)
dir = get_passability_direction(x,y)
@base_bitmap.fill_rect(x*32, y*32 + 22, 32, 10, dark_red) if dir[0]==false
@base_bitmap.fill_rect(x*32, y*32, 10, 32, dark_red) if dir[1]==false
@base_bitmap.fill_rect(x*32 + 22, y*32, 10, 32, dark_red) if dir[2]==false
@base_bitmap.fill_rect(x*32, y*32, 32, 10, dark_red) if dir[3]==false
end
end
end
update
end
#--------------------------------------------------------------------------
# * Get_passability_direction
#--------------------------------------------------------------------------
def get_passability_direction(x,y)
down = $game_map.passable?(x,y,2)
left = $game_map.passable?(x,y,4)
right = $game_map.passable?(x,y,6)
up = $game_map.passable?(x,y,8)
return [down, left, right, up]
end
#--------------------------------------------------------------------------
# * Event_passable?
#--------------------------------------------------------------------------
def event_passable?(x,y)
for event in $game_map.events.values
# If event coordinates are consistent with position
if event.x == x and event.y == y
# If through is OFF
unless event.through
if event.character_name != ""
# impassable
return false
end
end
end
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
if @base_bitmap != nil
@base_bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
super
if @counter == 0
@counter = @update_every_n_frame
self.bitmap = @base_bitmap.dup
dark_blue = Color.new(30,30,100,150)
for x in 0..$game_map.width-1
for y in 0..$game_map.height-1
if !event_passable?(x,y)
self.bitmap.fill_rect(x*32, y*32, 32, 32, dark_blue)
end
end
end
end
self.ox = $game_map.display_x / 4
self.oy = $game_map.display_y / 4
@counter -=1
end
end
#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
alias rataime_passability_spriteset_map_update update
SDK.log_alias(:Spriteset_Map, :update, :rataime_passability_spriteset_map_update)
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
if @sprite_passability == nil
@sprite_passability = Sprite_Passability_Map_Rataime.new(@viewport2)
end
@sprite_passability.update
rataime_passability_spriteset_map_update
end
alias rataime_passability_spriteset_map_dispose dispose
SDK.log_alias(:Spriteset_Map, :dispose, :rataime_passability_spriteset_map_dispose)
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
@sprite_passability.dispose
rataime_passability_spriteset_map_dispose
end
end
#==============================================================================
end
#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
=end