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

Project1

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

[已经过期] 如何右边显示敌人头像和血条我这段脚本有冲突

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6241
在线时间
1098 小时
注册时间
2015-8-15
帖子
657
跳转到指定楼层
1
发表于 2023-3-9 11:07:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 金芒芒 于 2023-3-9 16:00 编辑

RUBY 代码复制
  1. class Window_kg_status < Window_Base
  2. #我方  
  3.   def initialize(actor_id, window_index)
  4.     super(560 - window_index * 76 , 540, 117, 150)
  5.     @actor_id = actor_id
  6.     self.contents = Bitmap.new(width - 1, height- 1 )
  7.     self.opacity = 0
  8.     refresh
  9.   end
  10.  
  11.   def dispose
  12.     super
  13.   end
  14.  
  15.   def refresh
  16.     self.contents.clear
  17.     #draw_actor_name($game_actors[@actor_id], 0, 0)
  18.     draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, +1 ,+1)
  19.     draw_actor_hp($game_actors[@actor_id], 50, 25)
  20.     draw_actor_sp($game_actors[@actor_id], 134, 50)
  21.     draw_actor_cp($game_actors[@actor_id], 134, 80)
  22.   end
  23. #敌方
  24.   def initialize(enemy_id, window_index)
  25.     super(640 + window_index * 76 , 540, 117, 150)
  26.     @enemy_id = enemy_id
  27.     self.contents = Bitmap.new(width - 1, height- 1 )
  28.     self.opacity = 0
  29.     refresh
  30.   end
  31.  
  32.   def dispose
  33.     super
  34.   end
  35.  
  36.   def refresh
  37.     self.contents.clear
  38.     #draw_actor_name($game_actors[@actor_id], 0, 0)
  39.     draw_enemy_picture($game_enemy[@enemy_id].battler_name, $game_enemy[@enemy_id].battler_hue, +1 ,+1)
  40.     draw_enemy_hp($game_enemy[@enemy_id], 50, 25)
  41.     draw_enemy_sp($game_enemy[@enemy_id], 134, 50)
  42.     draw_enemy_cp($game_enemy[@enemy_id], 134, 80)
  43.   end
  44.  
  45.  
  46.  
  47. end
  48.  
  49. #enemy
  50.  
  51.  
  52.  
  53. class Window_Base < Window
  54.   #我方
  55.   def draw_actor_cp(actor, x, y, width = 90, height = 15)
  56.     w = [actor.cp, 100].min / 100 * width
  57.     self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
  58.     self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
  59.     self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
  60.   end
  61.  
  62.   def draw_actor_picture(actor_name, actor_hue, x, y)
  63.     bitmap = RPG::Cache.battler(actor_name,actor_hue)
  64.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  65.     self.contents.blt(x, y, bitmap, src_rect)
  66.   end
  67. #敌方
  68.   def draw_actor_cp(enemy, x, y, width = 90, height = 15)
  69.     w = [enemy.cp, 100].min / 100 * width
  70.     self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
  71.     self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
  72.     self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
  73.   end
  74.  
  75.   def draw_enemy_picture(enemy_name, enemy_hue, x, y)
  76.     bitmap = RPG::Cache.battler(enemy_name,enemy_hue)
  77.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  78.     self.contents.blt(x, y, bitmap, src_rect)
  79.   end  
  80.  
  81.  
  82. end

右边显示敌人头像.png (1.44 MB, 下载次数: 2)

右边显示敌人头像.png

CP技能.jpg (279.15 KB, 下载次数: 3)

CP技能.jpg

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

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

本版积分规则

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

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

GMT+8, 2024-4-20 00:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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