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

Project1

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

[已经解决] 关于改变颜色

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
40 小时
注册时间
2011-7-7
帖子
39
跳转到指定楼层
1
发表于 2011-7-30 14:59:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 fux2 于 2011-7-30 16:00 编辑
  1. #==============================================================================
  2. # ■ Window_EquipLeft
  3. #------------------------------------------------------------------------------
  4. #  装备画面的、显示角色能力值变化的窗口。
  5. #==============================================================================

  6. class Window_EquipLeft < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     actor : 角色
  10.   #--------------------------------------------------------------------------
  11.   def initialize(actor)
  12.     super(0, 0, 280, 192)
  13.     self.contents = Bitmap.new(width - 32, height - 32)
  14.     self.contents.font.color=Color.new(0,0,0,255)
  15.     @actor = actor
  16.     refresh
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 刷新
  20.   #--------------------------------------------------------------------------
  21.   def refresh
  22.     self.contents.clear
  23.     self.contents.font.size=15
  24.     self.contents.font.color=Color.new(0,0,0,255)
  25.     draw_actor_name(@actor, 4, 0)
  26.     draw_actor_level(@actor, 4, 32)
  27.     draw_actor_parameter(@actor, 4, 64, 0)
  28.     draw_actor_parameter(@actor, 4, 96, 1)
  29.     draw_actor_parameter(@actor, 4, 128, 2)
  30.     if @new_atk != nil
  31.       self.contents.font.color = Color.new(0,0,0,255)
  32.       self.contents.draw_text(160, 64, 40, 32, "→", 1)
  33.       self.contents.font.color = Color.new(0,0,0,255)
  34.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  35.     end
  36.     if @new_pdef != nil
  37.       self.contents.font.color = Color.new(0,0,0,255)
  38.       self.contents.draw_text(160, 96, 40, 32, "→", 1)
  39.       self.contents.font.color = Color.new(0,0,0,255)
  40.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  41.     end
  42.     if @new_mdef != nil
  43.       self.contents.font.color = Color.new(0,0,0,255)
  44.       self.contents.draw_text(160, 128, 40, 32, "→", 1)
  45.       self.contents.font.color = Color.new(0,0,0,255)
  46.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  47.     end
  48.   end
复制代码
我想把它显示的颜色都为  黑色  。字号都为11?怎么弄的颜色?
还有怎么添加其他的属性进去?
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 32)
    draw_actor_parameter(@actor, 4, 64, 0)
    draw_actor_parameter(@actor, 4, 96, 1)
    draw_actor_parameter(@actor, 4, 128, 2)
后面的数字0,1,2,分别代表的是攻击,物理防御,魔法防御?
怎么改颜色

点评

请去看版规,否则出现什么令大家不愉快的事情是吾辈不像看到的  发表于 2011-7-30 16:00

Lv1.梦旅人

虱子

梦石
0
星屑
121
在线时间
1782 小时
注册时间
2010-6-19
帖子
3597
2
发表于 2011-7-30 17:55:14 | 只看该作者
第一个请看Bitmap类和Font类的F1
剩下的看Window_Base的相关定义

http://rpg.blue/thread-175056-1-2.html
PVZ型塔防物一个
http://rpg.blue/thread-155199-1-2.html
RMXP技术讨论区手动认可帖,得到答案请认可
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-21 01:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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