| 赞 | 3 |
| VIP | |
| 好人卡 | |
| 积分 | 13 |
| 经验 | |
| 最后登录 | 2021-8-12 |
| 在线时间 | 118 小时 |
- 梦石
- 0
- 星屑
- 1293
- 在线时间
- 118 小时
- 注册时间
- 2017-7-14
- 回帖
- 112
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
emmm...在脚本中添加了银币的新币种..相关脚本如图,窗口代码附上。启动游戏时发现银币并没有显示==而且如果把金币字符串的颜色改掉金币也不见了...这是什么操作==求大佬们指教QWQ- #==============================================================================
- # ■ 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右)
复制代码 |
|