加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 liuziyuan201019 于 2012-7-6 10:28 编辑
绝对有人发过了……我承认我无聊……再发一次……
#============================================================================== #------------------------------------------------------------------------------ # 显示金钱的窗口。 #============================================================================== class Window_goldyz < Window_Base # ● 初始化窗口 def initialize super(0, 416, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 160 self.back_opacity = 255 self.contents_opacity = 255 self.visible = false @gold = $game_party.gold refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh @gold = $game_party.gold self.contents.clear #清除以前的东西 self.contents.font.color = Color.new(255, 255, 255, 255)#颜色 self.contents.draw_text(0, 0, 120, 32, @gold.to_s, 2) self.contents.font.color = Color.new(255, 255, 255, 255)#颜色 self.contents.draw_text(0, 0, 52, 32, $data_system.words.gold + ":") end #-------------------------------------------------------------------------- # ● 判断文字刷新。节约内存用 #-------------------------------------------------------------------------- def judge if @gold != $game_party.gold return true end return false end end class Scene_Map alias gold_yz_main main def main @goldyz_window = Window_goldyz.new @goldyz_window.x = 0 @goldyz_window.y = 416 @goldyz_window.opacity = 160 gold_yz_main @goldyz_window.dispose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- alias gold_yz_update update def update gold_yz_update @goldyz_window.visible = true @goldyz_window.refresh if @goldyz_window.judge end end
#==============================================================================
#------------------------------------------------------------------------------
# 显示金钱的窗口。
#==============================================================================
class Window_goldyz < Window_Base
# ● 初始化窗口
def initialize
super(0, 416, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 160
self.back_opacity = 255
self.contents_opacity = 255
self.visible = false
@gold = $game_party.gold
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
@gold = $game_party.gold
self.contents.clear #清除以前的东西
self.contents.font.color = Color.new(255, 255, 255, 255)#颜色
self.contents.draw_text(0, 0, 120, 32, @gold.to_s, 2)
self.contents.font.color = Color.new(255, 255, 255, 255)#颜色
self.contents.draw_text(0, 0, 52, 32, $data_system.words.gold + ":")
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
if @gold != $game_party.gold
return true
end
return false
end
end
class Scene_Map
alias gold_yz_main main
def main
@goldyz_window = Window_goldyz.new
@goldyz_window.x = 0
@goldyz_window.y = 416
@goldyz_window.opacity = 160
gold_yz_main
@goldyz_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias gold_yz_update update
def update
gold_yz_update
@goldyz_window.visible = true
@goldyz_window.refresh if @goldyz_window.judge
end
end
应用效果:
只是左下角的小小窗口……(众人:去死!) |