Pictures fading script
This scrip shows an image fading it in, showing it for a few seconds, and the fading it off.
-Doesn't use SDK.
-Has no other fancy functions
-It is compatible with almost everything
Compatibility:
-No errors found.
Usage:
"[, x][, y][, zoom_x][, zoom_y][, orgin]" optional.
Credits:
-Brewmeister for the comments.
-EOG for clearing some doubts and clearing the script out.
Script:
Paste above main
Be well
This scrip shows an image fading it in, showing it for a few seconds, and the fading it off.
-Doesn't use SDK.
-Has no other fancy functions
-It is compatible with almost everything
Compatibility:
-No errors found.
Usage:
Code:
$Game_FadingPics.fade("picName" [, x][, y][, zoom_x][, zoom_y][, orgin])
"[, x][, y][, zoom_x][, zoom_y][, orgin]" optional.
Credits:
-Brewmeister for the comments.
-EOG for clearing some doubts and clearing the script out.
Script:
Paste above main
Code:
#==============================================================================
# â– Pictures fading
#==============================================================================
# By: Nahchito & EOG (rmxp) / www.nachosonline.tk
# Date: 30/12/2008
# Version: V 0.1
#==============================================================================
class Game_FadingPics
#==============================================================================
# ** Initialize
#==============================================================================
def initialize
@fadeing_in = []
for picture in $game_screen.pictures
if picture == nil
next
end
@fadeing_in[picture.number] = false
end #if
end #def
#==============================================================================
# ** Fade
#==============================================================================
def fade(picName , x = 0, y = 0, zoom_x = 100, zoom_y = 100, orgin = 0)
if $scene.is_a?(Scene_Map)
for picture in $game_screen.pictures
if picture == nil
next
end
if picture.erased? #find empty picture
$game_screen.pictures[picture.number].show(picName, orgin, x, y, zoom_x, zoom_y, 0, 0)
@fadeing_in[picture.number] = true
break
end #if
end #for
end #if
end #def
#--------------------------------------------------------------------------
# ** Update
#--------------------------------------------------------------------------
def update
#fadeing
for picture in $game_screen.pictures
if picture == nil
next
end
if @fadeing_in[picture.number]
picture.opacity += 1
if picture.opacity == 255
@fadeing_in[picture.number] = false
end #if
end #if
if !@fadeing_in[picture.number] and picture.erased? != ""
picture.opacity -= 1
if picture.opacity == 0
picture.erase
end #if
end #if
end #for
end #def
end #class
class Scene_Map
alias old_main main
alias old_update update
def main
$Game_FadingPics = Game_FadingPics.new
old_main
end
def update
old_update
$Game_FadingPics.update
end
end
class Game_Picture
attr_accessor :opacity
def erased?
if @name == ""
return true
end
return false
end
end
Be well