#============================================================================== # ■ Window_Gold #------------------------------------------------------------------------------ # 显示金钱的窗口。 #============================================================================== #修改了金币的显示,添加了银币的显示 class Window_Gold < Window_Base #-------------------------------------------------------------------------- # ● 初始化窗口 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width ################################################################################ #self.contents.font.color = Color.new(248,181,81,0) self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) bitmap = Bitmap.new("Graphics/Money/" +"金币.png") self.contents.blt(124-cx, 8, bitmap, Rect.new(0,0,114,114),255) ################################################################################ self.contents.font.color = Color.new(191,191,191,0) self.contents.draw_text(4, 0, 0, 32, $game_party.silver.to_s,1) bitmap = Bitmap.new("Graphics/Money/" +"银币.png") self.contents.blt(62-cx, 8, bitmap, Rect.new(0,0,114,114),255) end end #描绘图片写法 self.contents.blt(x, y, bitmap, Rect.new(x, y, 宽, 高),透明度) #bitmap 是图片文件, 例如 bitmap = RPG::Cache.picture("一张图片") #描绘文字写法 self.contents.draw_text(x, y, 宽, 高, 要描绘的字符串, 对齐0左1中2右)
@Y$5~(VQ6CND9BTY]96FSCW.png (907.97 KB, 下载次数: 22)
{[Z0LOGXVOC6YVB9ZLLFK)0.png (899.02 KB, 下载次数: 7)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |