设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

关于如何让某变量显示在菜单金钱窗口内

查看数: 1840 | 评论数: 4 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2011-8-25 12:55

正文摘要:

如题,我使用的是这个脚本,将第二种货币设置在了变量100号里,不过我想让这个变量显示在菜单金钱窗口内,让玩家一打开就可以看到。该怎么做?是否应该在window_gold里设置? ...

回复

f26401004 发表于 2011-8-25 14:20:06
本帖最后由 f26401004 于 2011-8-25 14:52 编辑



self.contents.draw_text(4, 0, 120, 32, "貨幣名稱", 2)


也是於window_gold裡的refresh再加上這行看看- -
在提醒一下,
self.contents.draw_text(x, y, 寬度, 高度, "貨幣名稱", 對齊方式)
f26401004 发表于 2011-8-25 14:00:45
本帖最后由 f26401004 于 2011-8-25 14:05 编辑

於window_gold裡的refresh新增下面這行試試:


self.contents.draw_text(4, 0, 120, 32, $game_variables[100].to_s, 2)



位置應該不用再說了,若座標位置請自行調整。
亿万星辰 发表于 2011-8-25 13:59:54
我记得大概是4或者5年前。。。写过一个窗口教程,恰巧是用window_gold做的例子。
  1. class Window_Gold < Window_Base #Window_Gold 是Window_Base 的继承类
  2. def initialize #初始化
  3.    super(0, 0, 160, 64)#窗口坐标,大小
  4.    self.contents = Bitmap.new(width - 32, height - 32)#选择在width - 32, height - 32的位置写东西
  5.    refresh  #刷新
  6. end
  7.   def refresh  #定义刷新
  8.    self.contents.clear #清屏
  9.    cx = contents.text_size($data_system.words.gold).width#
  10.    self.contents.font.color = normal_color#定义字的颜色
  11.    self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)#写字
  12.    self.contents.font.color = system_color#定义字的颜色
  13.    self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)#写字
  14. end
  15. end
复制代码
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-18 06:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表