Flash in Title Screen VX

I have writen this little script in VX (not Ace) because I want to use the Flash-Effect in the Title Scene:

Spoiler
module Title_Flash # R G B Opacity Color = [255,255,255,255] Duration = 60 #In Frames Interval = [120,360] #In Framesendclass Scene_Title alias eugene222_main main def main @i = Title_Flash::Interval @counter = @i[0]+rand(@i[1]-@i[0]) eugene222_main end def flash_screen Graphics.transition(0) dur = Title_Flash:😀uration col = Color.new(*Title_Flash::Color) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) if dur > 0 loop do viewport.color = col Graphics.update break if dur == 0 col.alpha *= (dur - 1) / dur.to_f dur -= 1 end end viewport.dispose Graphics.freeze Graphics.transition(0) end alias eugene222_update update def update eugene222_update if @counter == 0 flash_screen @counter = @i[0]+rand(@i[1]-@i[0]) end @counter -= 1 endend
There is one Problem, during the Flash you cant control the command menu, it freezes.

So now i want to ask if there is an alternative way to make flashes during Scene_Title?

mfg
It's because you're using a loop within the update method. The update method already loops by default, so you're adding an additional loop.


You could add Graphics.update and Input.update commands within your loop, but the better way would be to look at how Game_Screen does its flash - it lets the update method calculate what the flash colour should be at each frame, then Spriteset_Map updates the flash based on that calculation.


First way is easier, but is a hack; second way follows the existing methods.


You didn't need to use VX to do this. Ace would have let you do it just as easily.
Yeah I made this for VX because a friend of mine use only VX and need this flash. But anyway thank you very much for the response, i will look into it.

Original thread: https://forums.rpgmakerweb.com/threads/flash-in-title-screen-vx.19908/