Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ============================================================================
- # (lagi males nulis dokumentasi)
- # Theo - In map additional picture
- # ----------------------------------------------------------------------------
- # 2013.06.23 - Nambahin pergantian opacity
- # 2013.06.21 - Nambahin opsi tint screen
- # 2013.06.08 - finished script
- # ============================================================================
- =begin
- Cara penggunaan :
- untuk show / hide, gunakan script call
- map_picture(true)
- map_picture(false)
- =end
- # ============================================================================
- # Konfigurasinya disini :
- # ============================================================================
- module THEO
- module MAP
- ADDITIONAL_PIC_NAME = "framehud"
- INCLUDE_TINT_SCREEN = false
- # nilai opacity minimal pas player nyentuh gambar (default : 50)
- MINIMUM_OPACITY = 50
- # nilai kecepatan fadenya (default : 20)
- PIC_FADE_SPEED = 20
- end
- end
- # ============================================================================
- # Udah ini aja :v
- # ============================================================================
- class Game_System
- attr_accessor :show_map_picture
- alias pre_mappic_init initialize
- def initialize
- pre_mappic_init
- init_mappic_members
- end
- def init_mappic_members
- @show_map_picture = true
- end
- end
- class Game_Interpreter
- # ganti aja nama defnya yg laen kalo ga sreg command script callnya :v
- def map_picture(bool)
- $game_system.show_map_picture = bool
- end
- end
- if THEO::MAP::INCLUDE_TINT_SCREEN
- class Spriteset_Map
- include THEO::MAP
- alias pre_pic_create_viewports create_viewports
- def create_viewports
- pre_pic_create_viewports
- @pic = Sprite.new
- @pic.viewport = @viewport2
- @pic.bitmap = Cache.picture(ADDITIONAL_PIC_NAME) rescue return
- end
- alias pre_pic_update update
- def update
- pre_pic_update
- @pic.visible = $game_system.show_map_picture
- update_pic_opacity
- end
- def update_pic_opacity
- if $game_player.screen_y <= 60 || $game_player.screen_y >= Graphics.height - 32
- @pic.opacity = [@pic.opacity - 20,THEO::MAP::MINIMUM_OPACITY].max
- else
- @pic.opacity = [@pic.opacity + 20,255].min
- end
- end
- alias pre_pic_dispose dispose
- def dispose
- pre_pic_dispose
- @pic.dispose
- end
- end
- else
- class Scene_Map < Scene_Base
- include THEO::MAP
- alias pre_inmap_pic_start start
- def start
- pre_inmap_pic_start
- create_map_pic
- end
- def create_map_pic
- @pic = Sprite.new
- @pic.bitmap = Cache.picture(ADDITIONAL_PIC_NAME) rescue return
- end
- alias pre_inmap_pic_update update
- def update
- pre_inmap_pic_update
- @pic.visible = $game_system.show_map_picture
- update_pic_opacity
- end
- def update_pic_opacity
- if $game_player.screen_y <= 60 || $game_player.screen_y >= Graphics.height - 32
- @pic.opacity = [@pic.opacity - PIC_FADE_SPEED,MINIMUM_OPACITY].max
- else
- @pic.opacity = [@pic.opacity + PIC_FADE_SPEED,255].min
- end
- end
- alias pre_inmap_pic_terminate terminate
- def terminate
- @pic.dispose
- pre_inmap_pic_terminate
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment