=begin
================================================================================
KURO DEMO EFFECT V3.2
================================================================================
Introduction :
On screen effect that could be called anywhere anytime.
================================================================================
Changelog :
V.3.2 (4-09-2014)
* Beberapa tambahan kemudahan akses melalui konfigurasi di module.
* Ditempa base nya, seharusnya lebih hemat proses.
V.3.1 (26-08-2014)
* Di portir ke VXA. Tapi masih bisa pake di VX kok.
V.3.0 (26-07-2013)
* INFINTY EFFECT! (Hindari pemakaian berlebihan kalo ga mau LAG)
* Rapihin.
* Sekarang bisa diaktif/nonaktif kan melalui event.
V.3.0 BETA (15-07-2012)
* EVOLUSI !!!!! Dari Kuro Demo Text menjadi Kuro Demo Effect.
* Sekarang pake picture yang ditaruh di folder System.
* Terlalu advanced dan masih kasar....
* Memiliki 4 jenis efek. Shakey, Blink, Spin, Frame Animation.
V.2.0 (30-06-2010)
* Rekonstruksi ulang! Langsung, plug and play!
* Nambahin random text position dengan men set align = 0
* Nambahin text opacity
* Nambahin demo ga jelas....
V.1.1 (16-06-2010)
* Menghilangkan windowskin yang katanya (saya?) cukup mengganggu
* Memperbaiki sedikit BUG pada text align....
V.1.0 (11-06-2010)
* Awal pembuatan, dan selesainya script.
* Jenis text
* Bisa edit color, font, bold, italic, position, size, dan windowskin
================================================================================
How to use :
Insert this script below ▼ Materials, but above ▼ Main Process.
Call this script via event
To activate : Kuro::Effect.create(ID)
To dispose : Kuro::Effect.delete(ID)
ID is the preset id you create on the configuration module.
================================================================================
=end
module Kuro
module Effect
PRESET =
#===============================================================================
# CONFIGURATION START
#===============================================================================
# Filename : The graphic file name in system folder.
# Effect : Up to 4 effects.
# 0 = No effect (fixed picture)
# 1 = Shakey2 Effect
# 2 = Frame Animation Effect
# 3 = Blink Effect
# 4 = Spin Effect
# Power : Effect rate of power. Effect 2 power is the number of frame.
# Position : 1 = upper left 2 = upper center 3 = upper right
# 4 = center left 5 = center 6 = center right
# 7 = lower left 8 = lower center 9 = lower right
# Set it to 0 will cause it to random position each call.
#===============================================================================
# Default animation delay for effect 2. Bigger is slower
ANIM = 6
# PRESET =
PRESET = # ID 0 to 2 started from title screen
PRESET = # ID 0 to 2 started from title screen
PRESET =
#===============================================================================
# CONFIGURATION END
#===============================================================================
def self.create(id)
$kde = DemoEffect.new(PRESET)
end
def self.delete(id)
$kde.dispose
$kde = nil
end
end
end
class DemoEffect
def initialize(id)
@file = id
@type = id
@pow = id
@pos = id
create
end
def create
@sp = Sprite.new
@sp.bitmap = Cache.system(@file)
@sp.src_rect.set(0,0,@sp.bitmap.width/@pow,@sp.bitmap.height) if @type == 2
@sp.z = 99999
@pos = 1 + rand(9) if @pos == 0
get_position
end
def update
case @type
when 0; @sp.update
when 1; shakey
when 2; animate
when 3; blink
when 4; spin
end
end
def get_position
wx = Graphics.width-@sp.width
hy = Graphics.height-@sp.height
case @pos
when 1; @sp.x=0; @sp.y=0
when 2; @sp.x=wx/2; @sp.y=0
when 3; @sp.x=wx; @sp.y=0
when 4; @sp.x=0; @sp.y=hy/2
when 5; @sp.x=wx/2; @sp.y=hy/2
when 6; @sp.x=wx; @sp.y=hy/2
when 7; @sp.x=0; @sp.y=hy
when 8; @sp.x=wx/2; @sp.y=hy
when 9; @sp.x=wx; @sp.y=hy
end
@ix=@sp.x; @iy=@sp.y
end
def shakey
@sp.x = [.max,@ix+@pow].min
@sp.y = [.max,@iy+@pow].min
end
def animate
a = Kuro::Effect::ANIM
b = Graphics.frame_count % (@pow*a)
@sp.src_rect.x = b/a*@sp.bitmap.width/@pow
end
def blink
@pow *= -1 if (@sp.opacity >= 255) or (@sp.opacity <= 0)
@sp.opacity += @pow
end
def spin
@sp.angle += @pow
end
def dispose
@sp.bitmap.dispose
@sp.dispose
end
end
class Scene_Title < Scene_Base
def start
super
SceneManager.clear
$kde =
Kuro::Effect.create(0) if Kuro::Effect::PRESET!=nil
Kuro::Effect.create(1) if Kuro::Effect::PRESET!=nil
Kuro::Effect.create(2) if Kuro::Effect::PRESET!=nil
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
end
end
class Scene_Base
alias potato update
def update
potato
for i in 0...$kde.length
$kde.update unless $kde == nil
end
end
end