Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Fog menu
- # Version : 1.0
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- # =============================================================================
- ($imported ||= {})[:Theo_FogMenu] = true
- # =============================================================================
- # CHANGE LOGS:
- # -----------------------------------------------------------------------------
- # 2013.05.24 - Started and Finished script
- # =============================================================================
- =begin
- Perkenalan :
- Script ini ngebikin kamu bisa nampilin fog di menu.
- Cara penggunaan :
- Pasang di bawah material namun di atas main
- Edit konfigurasinya
- Dibawah ini untuk penggunaan script call. kalo sewaktu-waktu u pengen ganti
- fog menu pas di tengah permainan.
- - $game_system.fog_menu_name = "namafilenya"
- - $game_system.fog_menu_opacity = (0 s.d 255)
- - $game_system.fog_menu_scroll_x = (bilangan bulat)
- - $game_system.fog_menu_scroll_y = (bilangan bulat)
- - $game_system.fog_menu_variance = (bilangan bulat)
- - $game_system.fog_menu_speed = (bilangan bulat)
- - $game_system.fog_behind_menu = (true/false)
- Terms of use :
- Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
- keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
- dipake buat komersil, jangan lupa, gw dibagi gratisannya.
- =end
- # =============================================================================
- # Konfigurasi :
- # =============================================================================
- module THEO
- module FOG
- FOG_NAME = "fogx" # Nama fog (harus ada di Graphics/picture)
- FOG_OPACITY = 255 # Opacity fognya
- FOG_SCROLL_X = -1 # Loop horizontal (minus = ke kanan)
- FOG_SCROLL_Y = -1 # Loop vertikal (minus = ke bawah)
- OPACITY_VARIANCE = 0 # Variasi opacitynya
- FADE_SPEED = 1 # Kecepatan berubah opacitynya
- BEHIND_MENU = true # Set true kalo pengen fog ada di belakang menu
- HIDE_SWITCH_ID = 0 # Fog di sembunyiin kalo switch dengan id ini ON
- end
- end
- # =============================================================================
- # Akhir dari konfigurasi. Jangan diedit kecuali ente ngerti
- # =============================================================================
- class Game_System
- attr_accessor :fog_menu_name
- attr_accessor :fog_menu_opacity
- attr_accessor :fog_menu_scroll_x
- attr_accessor :fog_menu_scroll_y
- attr_accessor :fog_menu_variance
- attr_accessor :fog_menu_speed
- attr_accessor :fog_behind_menu
- include THEO::FOG
- alias pre_fog_menu_init initialize
- def initialize
- pre_fog_menu_init
- init_fog_menu_member
- end
- def init_fog_menu_member
- @fog_menu_name = FOG_NAME
- @fog_menu_opacity = FOG_OPACITY
- @fog_menu_scroll_x = FOG_SCROLL_X
- @fog_menu_scroll_y = FOG_SCROLL_Y
- @fog_menu_variance = OPACITY_VARIANCE
- @fog_menu_speed = FADE_SPEED
- @fog_behind_menu = BEHIND_MENU
- end
- end
- class Scene_MenuBase < Scene_Base
- alias pre_fog_menu_start start
- def start
- pre_fog_menu_start
- create_fog_menu
- @fog_count = 0
- end
- def create_fog_menu
- @fog_menu = Plane.new($game_system.fog_behind_menu ? nil : @viewport)
- @fog_menu.bitmap = Cache.picture($game_system.fog_menu_name) rescue return
- @fog_menu.opacity = $game_system.fog_menu_opacity
- end
- alias pre_fog_update update
- def update
- pre_fog_update
- update_fog_menu
- end
- def update_fog_menu
- update_fog_scroll
- update_fog_opacity
- update_fog_visibility
- end
- def update_fog_scroll
- @fog_menu.ox += $game_system.fog_menu_scroll_x
- @fog_menu.oy += $game_system.fog_menu_scroll_y
- end
- def update_fog_opacity
- derajat = (@fog_count.to_f/180) * Math::PI
- @fog_menu.opacity = $game_system.fog_menu_opacity +
- (Math.sin(derajat) * $game_system.fog_menu_variance)
- @fog_count += (rand * $game_system.fog_menu_speed)
- end
- def update_fog_visibility
- @fog_menu.visible = !$game_switches[THEO::FOG::HIDE_SWITCH_ID]
- end
- alias pre_fog_terminate terminate
- def terminate
- dispose_fog_menu
- pre_fog_terminate
- end
- def dispose_fog_menu
- @fog_menu.dispose
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment