Hello. I am creating a script to show a map(um... the picture kind.) and your position according to your current map(sprite kind). But my problem is that when I create a rectangle and fill it, I can't see it. Maybe you can help me.
Script:
My rectangle instances are in red.
If you could help, that would be great!
Thanks in advance
-LonelyElf
Script:
Code:
#----------------------------------------------------------------------
# Begin
#---------------------------------------------------------------------------
module Glue
POSITION_COLOR = Color.new(0, 0, 0, 192)
end
class Game_Map
#--------------------------------------------------------------------------
# * Get Map ID
#--------------------------------------------------------------------------
def id
map_infos = load_data("Data/MapInfos.rvdata")
@id = map_infos[@map_id]
return @id
end
end
class SpriteMap < Sprite
#-----------------------------------------------------------------------------
# Initialize
#-----------------------------------------------------------------------------
def initialize(viewport=nil)
super(viewport)
self.bitmap = Cache.load_bitmap("Graphics/Pictures/", "Map.png")
self.x = self.x
self.y = self.y
self.z = self.z
end
#-----------------------------------------------------------------------------
# Dispose
#-----------------------------------------------------------------------------
def dispose
self.bitmap.dispose
for sprite in @icons + @weapon_icons
sprite.dispose
end
super()
end
#-----------------------------------------------------------------------------
# Update
#-----------------------------------------------------------------------------
def update
self.bitmap.clear
end
end
#-----------------------Scene----------------------------
class Scene_MapThing
def main
Graphics.wait(1)
initialize
end
def initialize(viewport = nil)
bitmap = Bitmap.new(200, 200)
@viewport = viewport
@x = 100
@y = 100
[color=red]bitmap.fill_rect(bitmap.rect, Glue::POSITION_COLOR)
map_rect = Rect.new(100, 100, @x, @y)[/color]
@mapic = SpriteMap.new(@viewport)
@mapic.x = 50
@mapic.y = 90
update
end
def update
Graphics.wait(1)
update_position
if Input.trigger?(Input::C)
$scene = Scene_Map.new
else
return
end
end
def update_position
@Map = $game_map.map_id
if @Map = 002
@x = 200
@y = 200
else
@x = 200
@y = 200
end
end
end
My rectangle instances are in red.
If you could help, that would be great!
Thanks in advance
-LonelyElf