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

Project1

 找回密码
 注册会员
搜索

求教一下战斗指令窗口的位置问题

查看数: 3230 | 评论数: 1 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2019-12-18 09:07

正文摘要:

本帖最后由 foot1982 于 2019-12-18 09:15 编辑 我想要把战斗指令窗口给挪到行动角色的头顶上 在Scene_Battle里面 备注掉了 #    @actor_command_window.viewport = @info_viewport 和 #    ...

回复

KB.Driver 发表于 2019-12-18 09:07:42
本帖最后由 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

点评

谢谢大佬,窗口坐标调整到了相对位置了,不过还有一个就是进入目标,技能,物品选择的时候希望能把ActorCommand这个窗口给隐藏掉,要怎么做呢?  发表于 2019-12-18 20:39

评分

参与人数 1+1 收起 理由
foot1982 + 1 认可答案

查看全部评分

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

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

GMT+8, 2024-11-16 14:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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