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

Project1

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

[已经解决] 人物颜色

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3770
在线时间
741 小时
注册时间
2016-6-2
帖子
211

开拓者

1
发表于 2018-8-11 12:45:44 | 显示全部楼层
本帖最后由 David_Exmachina 于 2018-8-11 12:48 编辑

RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 名称的描绘
  3.   #     actor : 角色
  4.   #     x     : 描画目标 X 坐标
  5.   #     y     : 描画目标 Y 坐标
  6.   #--------------------------------------------------------------------------
  7.   def draw_actor_name(actor, x, y)
  8.     case actor.id
  9.     when 1
  10.       self.contents.font.color = normal_color
  11.     when 2
  12.       self.contents.font.color = Color.new(173, 210, 32, 255)
  13.     when 3
  14.       self.contents.font.color = Color.new(0, 0, 0, 255)
  15.     when 4
  16.       self.contents.font.color = Color.new(191, 98, 10, 255)
  17.     when 5
  18.       self.contents.font.color = Color.new(114, 51, 4, 255)
  19.     when 6
  20.       self.contents.font.color = Color.new(233, 33, 33, 255)
  21.     when 7
  22.       self.contents.font.color = Color.new(252, 52, 52, 255)
  23.     when 8
  24.       self.contents.font.color = Color.new(111, 111, 111, 255)
  25.     end
  26.     self.contents.draw_text(x, y, 120, 32, actor.name)
  27.     self.contents.font.color = normal_color # 防止其他的某些文字变成这样的颜色(可根据实际情况省略)
  28.   end

这是根据角色的ID来变更名字颜色的脚本,
有多少角色就把when和下一行复制到有几个为止,
这上面的颜色代码可根据自己的喜好来更改。

评分

参与人数 2星屑 +60 +1 收起 理由
RyanBern + 60 认可答案
j296196585 + 1 谢谢大兄弟

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-16 22:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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