Script Name: Draw Logos/Pictures
Written By: Ty|Synthesize|
Current version: 1.1.5 (Build Release.bug fixes.features added)
Release Date: July 11, 2008
What is it?This simple script allows you to make a 'Slide-show' while in-game, or in other words, a bunch of pictures that appear one after another. It may be useful, it may not. Have fun. In the future, I may make it more flexible and usable for a wider range of people by including a zoom feature, and the ability to display an unlimited amount of images at one time, but I am lazy so who knows.
Screenshots:yeah...
Features:- Fade-in Logos/Pictures
- Fade-out Logos/Pictures
- Position pictures to your liking
- Easily add/modify images
- Supports an unlimited amount of logos
Demo:http://www.4shared.com/file/54908011/61f2d...Draw_Logos.htmlThe Script:CODE
#===============================================================================
# Display Logo - Game Edition
#===============================================================================
# Written by Ty|Synthesize|
# Version 1.1.5
# Original Release: July 11, 2008
# --- Version 1.0.5 July 12, 2008
# --- version 1.1.5 July 12, 2008
# Version Number = {[Build Release].[Bug Fixes].[Features Added]}
#-------------------------------------------------------------------------------
# Version Changelog
#-------------------------------------------------------------------------------
# Version 1.0.0 - Original release build
# Version 1.0.5 - Old
# --- Added Logo Coordinate Display positions
# --- Added Opacity duration
# --- Added ability to modify Logos in-game
# --- Added Fade-in
# --- Added Fade-out
# Version 1.1.5 - Current
# --- Fixed a bug when images did not skip.
#-------------------------------------------------------------------------------
# How to use this script:
#-------------------------------------------------------------------------------
class TyLogos
# Set attr values
attr_accessor :logo, :time, :fin_time, :fout_time, :x, :y, :draw_map
#-----------------------------------------------------------------------------
# Initiate Variables
#-----------------------------------------------------------------------------
def initialize
# Set Logo Array
@logo = []
# Set Time Arrary
@time = []
# Fade-In Time
@fin_time = []
# Fade-Out TIme
@fout_time = []
# X Position
@x = []
# Y Position
@y = []
# Draw Map?
@draw_map = true
end
#-----------------------------------------------------------------------------
# Add new logo
#-----------------------------------------------------------------------------
def add(name, time, fin, fout, x, y)
@logo.push(name)
@time.push(time)
@fin_time.push(fin)
@fout_time.push(fout)
@x.push(x)
@y.push(y)
end
#-----------------------------------------------------------------------------
# Clear Logos
#-----------------------------------------------------------------------------
def clear
@logo.clear
@time.clear
@fin_time.clear
@fout_time.clear
@x.clear
@y.clear
end
#-----------------------------------------------------------------------------
# Change self[nth] Value
#-----------------------------------------------------------------------------
def change(type, value, new)
case type
when "logo"
@logo[value] = new
when "time"
@time[value] = new
when "fin_time"
@fin_time[value] = new
when "fout_time"
@fout_time[value] = new
when "x"
@x[value] = new
when "y"
@y[value] = new
end
end
#------------------------------------------------------------------------------
# Delete:: Delete every value that is equal to X in every array.
#------------------------------------------------------------------------------
def delete(x)
@time.delete(x)
@fin_time.delete(x)
@fout_time.delete(x)
@x.delete(x)
@y.delete(x)
end
end
#-------------------------------------------------------------------------------
# Define Global Variable
#-------------------------------------------------------------------------------
$logo = TyLogos.new
#-------------------------------------------------------------------------------
# Main Script
#-------------------------------------------------------------------------------
class Draw_Logo
#-----------------------------------------------------------------------------
# Initiate Variables
#-----------------------------------------------------------------------------
def initialize
# This is the duration when waiting to swap logos
@wait = 0
# This is the duration before changing the Opacity
@wait_opacity = 0
# This is the current logo the script is drawing
@logo_number = 0
# This is the total amount of logos to draw
@array_size = $logo.logo.size
end
#-----------------------------------------------------------------------------
# Main Processing
#-----------------------------------------------------------------------------
def main
# This line sets "@bg" as the Map background
@bg = Spriteset_Map.new if $logo.draw_map
# This calls the method "Draw_Logo" which draws the logo based on @logo_number
draw_logo
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of Sprite, bitmaps and windows
@logo.dispose
@bg.dispose
end
#-----------------------------------------------------------------------------
# Draw Logo
#-----------------------------------------------------------------------------
def draw_logo
# This defiens @logo as a Sprite bitmap
@logo = Sprite.new
# This set the bitmap of @logo to the Logo to be drawn
@logo.bitmap = RPG::Cache.picture($logo.logo[@logo_number])
# This sets the X coordinate of the logo
@logo.x = $logo.x[@logo_number]
# This sets the Y Coordinate of the logo
@logo.y = $logo.y[@logo_number]
# This line sets the base opacity of a logo
@logo.opacity = 0 if $logo.fin_time[@logo_number] > 0
end
#-----------------------------------------------------------------------------
# Update Scene
#-----------------------------------------------------------------------------
def update
# This checks if @wait if equal to the total duration per logo or if a key is being pressed
if @wait >= $logo.time[@logo_number]
# Initiate Fade-out
if $logo.fout_time[@logo_number] > 0
if Input.trigger?(Input::C)
@wait = 0
break_loop
else
value = 255 / $logo.fout_time[@logo_number]
@logo.opacity -= value
@wait = 0 if @logo.opacity == 0
break_loop if @logo.opacity == 0
end
else
# Call method "break_loop"
break_loop
# Resets teh wait value
@wait = 0
end
else
# Initiate Fade-in
if @logo.opacity < 255
if Input.trigger?(Input::C)
@logo.opacity = 255
else
value = 255 / $logo.fin_time[@logo_number]
@logo.opacity += value
end
else
if Input.trigger?(Input::C)
@wait = 0
break_loop
else
wait
end
end
end
end
#-----------------------------------------------------------------------------
# Break Loop
#-----------------------------------------------------------------------------
def break_loop
# Since one logo has played, draw the next logo unless at the end of the array
@logo_number += 1 unless @logo_number == @array_size
# Dispose the previous logo so it does not appear behind the next one
@logo.dispose
# Automatically end, or continue the script once Logos are drawn
if @logo_number != @array_size
draw_logo
else
$scene = Scene_Map.new
end
end
#-----------------------------------------------------------------------------
# Wait:: Allows Wait Times
#-----------------------------------------------------------------------------
def wait
# Add one to the @wait variable
@wait += 1
end
end
#-------------------------------------------------------------------------------
# Requested by Axerax
#-------------------------------------------------------------------------------
# Terms of Use:
#-------------------------------------------------------------------------------
# Releases may be modified, but editied releases may not be re-distributed.
# Releases may be redistributed, but only if the release is unmodified
# Creadit MUST be given at all times.
# Releases with "Written by Ty|Synthesize|" may be used, free of charge in
# freeware or commercial projects, but credit must ALWAYS be given.
# Commercial projects must report to the contact email below before using.
# By using these scripts, you agree to the above.
#-------------------------------------------------------------------------------
# Written by Ty|Synthesize|
# Contact: Tiggerville2929@gmail.com
# Original Release Date: July 11, 2008
#===============================================================================
# Draw Logo - Game Edition
#===============================================================================
Usage:When in-game, use a call script command with the following. use it as many times as you want:
CODE
$logo.add(logoname, duration, fade-in time, fade-out time, x coordinate, y coordinate)
Then to draw the logos/pictures do a call script with the following:
CODE
$scene = Draw_Logos.new
License:- Releases may be modified, but editied releases may not be re-distributed.
- Releases may be redistributed, but only if the release is unmodified
- Credit MUST be given at all times.
- Releases with "Written by Ty|Synthesize|" may be used, free of charge in freeware or commercial projects, but credit must ALWAYS be given.
- Commercial projects must report to the contact email below before using.
- By using these scripts, you agree to the above.
Questions? Concerns? Post them.