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

Project1

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

[已经过期] 如何用Sprite做显示ARPG群战的角色头像

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6286
在线时间
1103 小时
注册时间
2015-8-15
帖子
658
跳转到指定楼层
1
发表于 2023-4-8 15:58:50 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用class Sprite_Character < RPG::Sprite
还是用class Sprite_map < RPG::Sprite





RUBY 代码复制
  1. class Window_kg_status < Window_Base
  2. class Sprite_Character < RPG::Sprite
  3.  
  4.   #我方  
  5.   def initialize(actor_id, window_index)
  6.     super(540 - window_index * 76 , 540, 117, 190)
  7.     @actor_id = actor_id
  8.     self.contents = Bitmap.new(width - 1, height- 1 )
  9.     self.opacity = 0
  10.     refresh
  11.   end
  12.  
  13.   def dispose
  14.     super
  15.   end
  16.  
  17.   def refresh
  18.     self.contents.clear
  19.     #draw_actor_name($game_actors[@actor_id], 0, 0)
  20.     draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, -1 ,+1)
  21.     draw_actor_hp($game_actors[@actor_id], 1, 110)
  22.     draw_actor_sp($game_actors[@actor_id], 134, 135)
  23.     draw_actor_cp($game_actors[@actor_id], 134, 160)
  24.   end
  25.  
  26.   class Window_Base < Window
  27.   #我方
  28.   def draw_actor_cp(actor, x, y, width = 90, height = 15)
  29.     w = [actor.cp, 100].min / 100 * width
  30.     self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
  31.     self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
  32.     self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
  33.   end
  34.  
  35.   def draw_actor_picture(actor_name, actor_hue, x, y)
  36.     bitmap = RPG::Cache.battler(actor_name,actor_hue)
  37.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  38.     self.contents.blt(x, y, bitmap, src_rect)
  39.   end

队标id.png (651.41 KB, 下载次数: 1)

队标id.png

完成.png (220.89 KB, 下载次数: 1)

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

本版积分规则

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

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

GMT+8, 2024-4-27 23:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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