Project1

标题: 求教一下战斗指令窗口的位置问题 [打印本页]

作者: foot1982    时间: 2019-12-18 09:07
标题: 求教一下战斗指令窗口的位置问题
本帖最后由 foot1982 于 2019-12-18 09:15 编辑

我想要把战斗指令窗口给挪到行动角色的头顶上

在Scene_Battle里面 备注掉了
#    @actor_command_window.viewport = @info_viewport

#    @actor_command_window.x = Graphics.width

结果变成如图
指令窗口的位置是改了,但是接下来就不知道怎么做了,坐标是可以调整,但是不知道怎么根据行动人物的不同放在相应的人物头像顶上
另外,还想要的一个效果是选择了战斗指令,出现后来这个技能窗口,物品窗口,目标选择窗口之类的时候,把这个战斗指令窗口给隐藏掉
特来求教要怎么做才好。


作者: KB.Driver    时间: 2019-12-18 09:07
本帖最后由 KB.Driver 于 2019-12-18 22:00 编辑
  



@foot1982

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Battle
  3. #------------------------------------------------------------------------------
  4. #  战斗画面
  5. #==============================================================================
  6.  
  7. class Scene_Battle
  8.   #--------------------------------------------------------------------------
  9.   # ● 指令“攻击”
  10.   #--------------------------------------------------------------------------
  11.   alias command_attack_for_hiding_actor_command_window command_attack
  12.   def command_attack
  13.     command_attack_for_hiding_actor_command_window
  14.     @actor_command_window.hide
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 指令“技能”
  18.   #--------------------------------------------------------------------------
  19.   alias command_skill_for_hiding_actor_command_window command_skill
  20.   def command_skill
  21.     command_skill_for_hiding_actor_command_window
  22.     @actor_command_window.hide
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 指令“物品”
  26.   #--------------------------------------------------------------------------
  27.   alias command_item_for_hiding_actor_command_window command_item
  28.   def command_item
  29.     command_item_for_hiding_actor_command_window
  30.     @actor_command_window.hide
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 敌人“取消”
  34.   #--------------------------------------------------------------------------
  35.   alias on_enemy_cancel_for_showing_actor_command_window on_enemy_cancel
  36.   def on_enemy_cancel
  37.     on_enemy_cancel_for_showing_actor_command_window
  38.     if (w = @actor_command_window).current_symbol == :attack then w.show end
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 技能“取消”
  42.   #--------------------------------------------------------------------------
  43.   alias on_skill_cancel_for_showing_actor_command_window on_skill_cancel
  44.   def on_skill_cancel
  45.     on_skill_cancel_for_showing_actor_command_window
  46.     @actor_command_window.show
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 物品“取消”
  50.   #--------------------------------------------------------------------------
  51.   alias on_item_cancel_for_showing_actor_command_window on_item_cancel
  52.   def on_item_cancel
  53.     on_item_cancel_for_showing_actor_command_window
  54.     @actor_command_window.show
  55.   end
  56. end
  57.  
  58. #==============================================================================
  59. # ■ Window_ActorCommand
  60. #------------------------------------------------------------------------------
  61. #  战斗画面中,选择角色行动的窗口。
  62. #==============================================================================
  63.  
  64. class Window_ActorCommand
  65.   #--------------------------------------------------------------------------
  66.   # ● 设置
  67.   #--------------------------------------------------------------------------
  68.   alias setup_for_position_fixing setup
  69.   def setup(actor)
  70.     setup_for_position_fixing(actor)
  71.     index = $game_party.members.index(actor)
  72.     status_window = SceneManager.scene.instance_variable_get(:@status_window)
  73.     whole_width = status_window.width
  74.     self.x = index * whole_width / $game_party.max_battle_members
  75.     self.y = Graphics.height - status_window.height - self.height
  76.     self.show
  77.   end
  78. end






欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1