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

Project1

 找回密码
 注册会员
搜索
查看: 2657|回复: 3
打印 上一主题 下一主题

[已经解决] 问一下 金钱>100000数字为绿色 >1000000数字红色怎么弄

[复制链接]

Lv2.观梦者

梦石
0
星屑
365
在线时间
31 小时
注册时间
2014-12-28
帖子
13
跳转到指定楼层
1
发表于 2019-6-8 19:07:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
之前研究过,不太记得怎么写了!

Lv4.逐梦者

梦石
0
星屑
14351
在线时间
2158 小时
注册时间
2019-1-24
帖子
1121

R考场第七期纪念奖

2
发表于 2019-6-8 22:39:17 | 只看该作者
Window_Gold类里面改下就行了

def refresh
    self.contents.clear
    cx = contents.text_size($data_system.words.gold).width
    if $game_party.gold >= 1000000
      self.contents.font.color = Color.new(255, 0, 0, 255)
    elsif $game_party.gold >= 100000 and $game_party.gold < 1000000
      self.contents.font.color = Color.new(0, 255, 0, 255)
    else
      self.contents.font.color = normal_color
    end

    self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
  end

点评

哈哈,对啊,又精简了  发表于 2019-6-9 20:42
谢谢老铁  发表于 2019-6-9 09:00

评分

参与人数 2星屑 +50 +1 收起 理由
RyanBern + 50 认可答案
张咚咚 + 1 由于优先级的问题 and 后面可以去掉.

查看全部评分

回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-9-21 01:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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