Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Fade in to blackscreen

Sorry if this has been answered before. I have had a look but couldnt find it. Also I may have missed it because my eyes are bad.
Anyway I'm trying to create a fade into black screen and fade out effect. I wasnt so sure if this would need a script of if it was possible to manualy do this so I posted this question here. Anyway any help in the matter would be really great.
basically I need

1. A means of fadeing a map to a black screen.
2. A means of fadeing from a black screen to a map.

thanks for your time.
HG
 
#==============================================================================
# ** Fade Warp (Fondu téléport)
#------------------------------------------------------------------------------
# Trebor777
# 2.0
# 18/05/2006
#------------------------------------------------------------------------------
# Génère automatiquement un fondu sur écran noir, pour les téléportations vers
# une map différente de l'actuelle.
# Automatically Create a Black Screen's fade, for player transfer to a different
# map from the current one.
#==============================================================================

#==============================================================================
# ** Interpreter (part 2)
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
#--------------------------------------------------------------------------
# * Event Command Execution
#--------------------------------------------------------------------------
$fade_wait = 10 #if =0, désactivate the effect.
#--------------------------------------------------------------------------
alias fade_warp_execute_command execute_command
def execute_command
# If last to arrive for list of event commands
if @index >= @list.size - 1
# End event
@a_fait = nil
command_end
# Continue
return true
end
parameters = @list[@index].parameters
id=$game_map.map_id #id of the current map
# if the command is "transfer player"
if @list[@index].code==201 and @a_fait==nil
# if destination's ID, is different from the current map's one, :
if (parameters[0]==0 and parameters[1]!=id) or (parameters[0]!=0 and $game_variables[parameters[1]]!=id)
# Change screen tone to black
black_tone=RPG::EventCommand.new(223,0,[Tone.new(-255,-255,-255,0),$fade_wait])
# Wait
wait=RPG::EventCommand.new(106,0,[$fade_wait])
# Change screen tone to Normal
no_tone=RPG::EventCommand.new(223,0,[Tone.new(0,0,0,0),$fade_wait])
# insert of the 2 first commands before the transfer player one
if $fade_wait>0
@list.insert(0,black_tone,wait)
# insert of the last after the transfer player one
@list.insert(@list.size - 1,no_tone)
# flag in order to mark the execution
end
@a_fait = true
end
end
fade_warp_execute_command
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------

Add it above main, etc etc. But yeah, the tone thing works too.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top