Hello everybody,
I'm currently working on a Final Fantasy Tactics / Fire Emblem / Advance Wars like game. To implement the different phases (chiefly selection, player and enemy phases), I need to notify the player of the transition between the phases. To do this, I want to show a picture at 0 opacity, fade it in via move, wait 90 seconds, and fade it out again. I have so far implemented this successfully by putting an autorun event on the map. Now I wanted to transition to a script based approach, but I have not been able to get it to work.
So far, I have tried the following:
CODE
$game_map.screen.pictures[1].make(@phase)
20.times { Graphics.update }
$game_map.screen.pictures[1].fade_in
90.times { Graphics.update }
$game_map.screen.pictures[1].fade_out
with an extension to Game_Picture as follows:
CODE
# make simpler calls to pictures
class Game_Picture
def make(phase)
phase[0] = phase[0].capitalize[0]
banner = phase + 'PhaseBanner'
@name = banner
@blend_type = 0
@opacity = 0
end
def fade_in
@target_opacity = 255
@duration = 30
end
def fade_out
@target_opacity = 0
@duration = 60
end
end
The above code does not work correctly. It does not cause a fade in animation; instead, the picture's opacity remains 0 until the fading out starts. I've tried using different wait methods and even threading the fading away from the main program as such:
CODE
$game_map.screen.pictures[1].make(@phase)
thread = Thread.new {
$game_map.screen.pictures[1].fade_in
sleep(3)
$game_map.screen.pictures[1].fade_out
}
thread.join
I'm at a loss here as to what I might have overlooked.
Regards,
j-frost
This post has been edited by j-frost: Jan 20 2013, 04:17 AM