查看: 1331|回复: 4

[已经解决] 求地图上显示角色属性的脚本

  [复制链接]
梦石
0
星屑
50
在线时间
1 小时
注册时间
2011-4-13
回帖
8
发表于 2011-8-18 22:33:54 | 显示全部楼层 |阅读模式

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

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

×
求在地图上显示角色等级、HP、SP的脚本,谢谢了
梦石
0
星屑
55
在线时间
295 小时
注册时间
2008-5-24
回帖
469
发表于 2011-8-18 23:05:04 | 显示全部楼层
http://rpg.blue/forum.php?mod=vi ... 9083&highlight=

大家要好好爱 度娘 。。。
前方
迷茫
后方
已不在
回复

使用道具 举报

梦石
0
星屑
50
在线时间
73 小时
注册时间
2010-8-2
回帖
134
发表于 2011-8-18 23:34:50 | 显示全部楼层
本帖最后由 tyrpg 于 2011-8-18 23:38 编辑

#显示人物HP、SP、等级-tyrpg
class Window_ahsl < Window_Base
def initialize
    super(0, 0, 640, 480)
    self.windowskin = ()
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = Font.default_name
    self.contents.font.size = 18
    @renwu = $game_party.actors[0]
    xianshixinxi
end
  def xianshixinxi
    self.contents.clear
    self.contents.font.color = normal_color
      dengjimingchengxianshi(@renwu, 0, 0, 170)
      hpxianshi(@renwu, 0, 32)
      spxianshi(@renwu, 0, 64)
    end
def update
    super
  end
end
class Window_Base < Window  
  def hpxianshi(actor, x, y, width = 144)
    ahp = "HP: "+"#{actor.hp}"+"/"+"#{actor.maxhp}"
    self.contents.draw_text(x, y,320, 50,ahp )
    self.contents.font.color = normal_color
end
def spxianshi(actor, x, y, width = 144)
      asp = "SP: "+"#{actor.sp}"+"/"+"#{actor.maxsp}"
    self.contents.draw_text(x, y,320, 50,asp )
    self.contents.font.color = normal_color
end  
    def dengjimingchengxianshi(actor, x, y, width = 120)
    text = "Lv:#{actor.level}"
    text2 = "#{actor.name}"+"  "+text
    self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
    self.contents.draw_text(x, y, width, 32, text2)
  end
end
class Scene_Map
  alias old_main main
  def main
    @xianshi_Window = Window_ahsl.new
    old_main
    @xianshi_Window.dispose
  end
  alias old_update update
  def update
    @xianshi_Window.update
    old_update
  end
end
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1 小时
注册时间
2011-4-13
回帖
8
 楼主| 发表于 2011-8-19 17:46:17 | 显示全部楼层
tyrpg 发表于 2011-8-18 23:34
#显示人物HP、SP、等级-tyrpg
class Window_ahsl < Window_Base
def initialize

很好的说,但是怎么把字的颜色调一下?

点评

先给分吧……  发表于 2011-8-19 19:53
回复

使用道具 举报

梦石
0
星屑
50
在线时间
73 小时
注册时间
2010-8-2
回帖
134
发表于 2011-8-19 19:51:49 | 显示全部楼层
要什么颜色的啊


tyrpg于2011-8-19 20:00补充以下内容:
self.contents.font.color = normal_color
在这一行可以改颜色
那一句里面 normal_color 是白色 可以改成别的颜色
紫改为:text_color(1)
红改为:text_color(2)
绿改为:text_color(3)
蓝改为:text_color(4)
黄改为:text_color(6)
粉改为:text_color(7)
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部