查看: 1700|回复: 0

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

[复制链接]
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2023-3-9 11:07:17 | 显示全部楼层 |阅读模式

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

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

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

[pre lang="ruby"]class Window_kg_status < Window_Base
#我方  
  def initialize(actor_id, window_index)
    super(560 - window_index * 76 , 540, 117, 150)
    @actor_id = actor_id
    self.contents = Bitmap.new(width - 1, height- 1 )
    self.opacity = 0
    refresh
  end
  
  def dispose
    super
  end
  
  def refresh
    self.contents.clear
    #draw_actor_name($game_actors[@actor_id], 0, 0)
    draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, +1 ,+1)
    draw_actor_hp($game_actors[@actor_id], 50, 25)
    draw_actor_sp($game_actors[@actor_id], 134, 50)
    draw_actor_cp($game_actors[@actor_id], 134, 80)
  end
#敌方
  def initialize(enemy_id, window_index)
    super(640 + window_index * 76 , 540, 117, 150)
    @enemy_id = enemy_id
    self.contents = Bitmap.new(width - 1, height- 1 )
    self.opacity = 0
    refresh
  end
  
  def dispose
    super
  end
  
  def refresh
    self.contents.clear
    #draw_actor_name($game_actors[@actor_id], 0, 0)
    draw_enemy_picture($game_enemy[@enemy_id].battler_name, $game_enemy[@enemy_id].battler_hue, +1 ,+1)
    draw_enemy_hp($game_enemy[@enemy_id], 50, 25)
    draw_enemy_sp($game_enemy[@enemy_id], 134, 50)
    draw_enemy_cp($game_enemy[@enemy_id], 134, 80)
  end



end

#enemy



class Window_Base < Window
  #我方
  def draw_actor_cp(actor, x, y, width = 90, height = 15)
    w = [actor.cp, 100].min / 100 * width
    self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
    self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
    self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
  end
  
  def draw_actor_picture(actor_name, actor_hue, x, y)
    bitmap = RPG::Cache.battler(actor_name,actor_hue)
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, src_rect)
  end
#敌方
  def draw_actor_cp(enemy, x, y, width = 90, height = 15)
    w = [enemy.cp, 100].min / 100 * width
    self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
    self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
    self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
  end
  
  def draw_enemy_picture(enemy_name, enemy_hue, x, y)
    bitmap = RPG::Cache.battler(enemy_name,enemy_hue)
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, src_rect)
  end  
  
  
end[/pre]
右边显示敌人头像.png
CP技能.jpg
完成.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部