查看: 2197|回复: 1

[已经解决] 自改金钱脚本问题

[复制链接]
梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2015-9-29 22:25:40 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 347780682 于 2015-9-29 22:35 编辑

自己按照金钱脚本创建了一个窗口 但是出现了下面的情况 第一个0是白色的剩下的全是蓝色的 我想让他们全变白色 求解
Y@JCK44L1B7T7Z90[M_}5FD.png
[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
#  显示持有金钱的窗口
#==============================================================================

$a_id = 100          #显示变量的编号
$b_id = 101          #显示变量的编号
$c_id = 102          #显示变量的编号
$d_id = 103          #显示变量的编号
$e_id = 104          #显示变量的编号
$f_id = 105          #显示变量的编号
$g_id = 106          #显示变量的编号

class Window_Branch < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x,y,w)
    super(x, y+45, w, fitting_height(1)+185)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_currency_value(value,"SSS级支线", 14, 0, contents.width - 8)
    draw_currency_value(value1,"SS级支线", 14, 30, contents.width - 8)
    draw_currency_value(value2,"S级支线", 14, 60, contents.width - 8)
    draw_currency_value(value3,"A级支线", 14, 90, contents.width - 8)
    draw_currency_value(value4,"B级支线", 14, 120, contents.width - 8)
    draw_currency_value(value5,"C级支线", 14, 150, contents.width - 8)
    draw_currency_value(value6,"D级支线", 14, 180, contents.width - 8)
  end
  #--------------------------------------------------------------------------
  # ● 获取持有金钱
  #--------------------------------------------------------------------------
  def value
      self.contents.draw_text(0,0,64-36,24,$game_variables[$a_id].to_s,1)
    end
  def value1
      self.contents.draw_text(0,0,64-36,24+63,$game_variables[$b_id].to_s,1)
    end
  def value2
      self.contents.draw_text(0,0,64-36,24+123,$game_variables[$c_id].to_s,1)
    end  
  def value3
      self.contents.draw_text(0,0,64-36,24+180,$game_variables[$d_id].to_s,1)
    end  
  def value4
      self.contents.draw_text(0,0,64-36,24+241,$game_variables[$e_id].to_s,1)
    end  
  def value5
      self.contents.draw_text(0,0,64-36,24+298,$game_variables[$f_id].to_s,1)
    end  
  def value6
      self.contents.draw_text(0,0,64-36,24+360,$game_variables[$g_id].to_s,1)
  end
  #--------------------------------------------------------------------------
  # ● 获取货币单位
  #--------------------------------------------------------------------------
  def currency_unit
    Vocab::currency_unit
  end
  #--------------------------------------------------------------------------
  # ● 打开窗口
  #--------------------------------------------------------------------------
  def open
    refresh
    super
  end
end
[/pre]

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-9-30 07:11:31 | 显示全部楼层
value 方法中请不要绘制,而是返回一个值就好

剩下的颜色问题就看 draw_currency_value 的实现了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部