Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------------------------------------------
- # Don't remove this header!
- #-------------------------------------------------------------------------------
- # Show Picture/Variable with Switch
- # by Trihan
- #
- # Version: 1.0
- #
- # This script is commissioned by Batworks Software.
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # Version History
- #-------------------------------------------------------------------------------
- # 1.0 - Initial script.
- #-------------------------------------------------------------------------------
- module TLBVarShowPic
- #-------------------------------------------------------------------------------
- # Config
- SwitchID = 1
- VarID = 1
- Pic = "Nature"
- PicX = 10
- PicY = 10
- VarOffsetX = 50
- VarOffsetY = 20
- # ** End Config **
- #
- # WARNING: Editing anything beyond this point may result in the script no
- # longer functioning as intended.
- #-------------------------------------------------------------------------------
- end
- class Scene_Map < Scene_Base
- include TLBVarShowPic
- alias :tlb_vsp_update_7xl6 :update
- def update
- tlb_vsp_update_7xl6
- if $game_switches[SwitchID]
- @tlb_varpic = Sprite.new if !@tlb_varpic
- @tlb_varpic.bitmap = Cache.system(Pic)
- @tlb_varpic.x = PicX
- @tlb_varpic.y = PicY
- @tlb_var = Sprite.new if !@tlb_var
- value = $game_variables[VarID].to_s
- text_width = @tlb_varpic.bitmap.text_size(value)
- @tlb_var.bitmap = Bitmap.new(text_width.width, 24)
- @tlb_var.bitmap.draw_text(0, 0, text_width, 24, value)
- @tlb_var.x = @tlb_varpic.x + VarOffsetX
- @tlb_var.y = @tlb_varpic.y + VarOffsetY
- @tlb_varpic.visible = true
- @tlb_var.visible = true
- else
- @tlb_varpic.visible = false if @tlb_varpic
- @tlb_var.visible = false if @tlb_var
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement