I am totally lost as to why this is not working, because I've done it like this before I'm sure and it has worked.
If I remove ".bitmap.clear" then it works fine. But I need bitmap.clear so I don't keep writing the same bitmap on top of each other whenever I want to redraw the flag.
Here's the piece of code:
Only fill_rect and draw_text show up, not the bitmap I'm actually trying to place. I have no idea why and it's really making me crazy.
Note that the code is a mess because I'm trying out lots of different things to make the bitmap appear, but nothing is working. s___s
If I remove ".bitmap.clear" then it works fine. But I need bitmap.clear so I don't keep writing the same bitmap on top of each other whenever I want to redraw the flag.
Here's the piece of code:
Code:
def draw_flag
@flag[1] = Sprite.new(@viewport)
@flag[1].z = 9000 - 1
@flag[1].bitmap = RPG::Cache.picture(dir + 'bg_flag_fill')
set_flag_fill
end
def set_flag_fill
@flag[1].bitmap.clear
@flag[1] = Sprite.new(@viewport)
@flag[1].z = 9000 - 1
@flag[1].opacity = 255
@flag[1].visible = true
@flag[1].bitmap = RPG::Cache.picture(dir + 'bg_flag_fill')
src_bitmap = RPG::Cache.picture(dir + 'bg_flag_fill')
rect = Rect.new(0, 0, 640, 480)
@flag[1].bitmap = Bitmap.new(640, 480)
@flag[1].bitmap.blt(0, 0, src_bitmap, rect)
@flag[1].visible = true
@flag[1].bitmap.draw_text(0,150,640,420,"alalalalalalalalalalala", 1)
@flag[1].bitmap.blt(-100, -100, src_bitmap, rect)
@flag[1].bitmap.fill_rect(0, 0, 50, 50, Color.new(200,200,200,50))
end
Only fill_rect and draw_text show up, not the bitmap I'm actually trying to place. I have no idea why and it's really making me crazy.
Note that the code is a mess because I'm trying out lots of different things to make the bitmap appear, but nothing is working. s___s