Project1

标题: VX地图界面显示主人公血魔 [打印本页]

作者: qq894033418    时间: 2012-7-27 00:05
标题: VX地图界面显示主人公血魔
请问如何在地图界面显示主人公的血魔条,只需要最简单的2个条就好。一红一蓝,进入战斗消失。

最好能告诉我如何更改位置和颜色 非常感谢dsu_plus_rewardpost_czw
作者: a364774426    时间: 2012-7-27 01:16
本帖最后由 a364774426 于 2012-7-27 01:19 编辑
  1. #============================================================================
  2. # Jens009 Simple HP/SP/State HUD
  3. # Version 2.0
  4. # Release Date: August 11,2008
  5. # Description: Display an HP/SP and State HUD information in map.
  6. # Compatibility: Should be compatible with any system
  7. # Configuration:
  8. #   I. Turning off the HUD in game
  9. #       use the call script $game_system.show_hud = true/false
  10. #           true = show HUD, false = disable HUD
  11. #   II. Changing maximum information shown
  12. #        look at SHOW_MAX under JCONFIG, you can change the value to show
  13. #        how many of the actors in the party to display their information
  14. #        by default, it is set to show only 2 actors.
  15. #   III. Changing maximum information shown in game
  16. #        use the call script JCONFIG::SHOW_MAX = *integer*
  17. #        You can change the amount of actors displayed in the HUD in game.
  18. #        simply change integer to the value you want.
  19. #   IV.  Changing Update methods
  20. #        if you want the HUD to always update, set ALWAYS_UPDATE_HUD to true
  21. #        but if you want to only update the HUD whenever you want to, set
  22. #        this to false.
  23. #        When $game_sysyem.always_update is false, you can update the hud
  24. #        manually in game using the call script $game_system.refresh_hud = true.
  25. #        this will refresh the hud information once.
  26. #        However, you can also switch between always updating the HUD and
  27. #        only updating the hud once during in game.
  28. #        Simply use the call script:
  29. #           $game_sysyem.always_update = true/false
  30. #        and to reupdate once
  31. #           $game_system.refresh_hud = true
  32. #
  33. # Optimization to achieve higher FPS
  34. #    1) Set SHOW_MAX to a low value
  35. #    You can also:
  36. #    2) Set $game_sysyem.always_update = false
  37. #      2.1) Use $game_temp.refresh_hud = true to reupdate the hud manually.
  38. #============================================================================
  39. module JCONFIG
  40.   SHOW_MAX = 6 # By default, show 4 actor's information
  41. end


  42. #======================================
  43. # Game_System edit
  44. #=====================================
  45. class Game_System
  46.   # Add new instance
  47.   attr_accessor :refresh_hud
  48.   attr_accessor :show_hud
  49.   attr_accessor :always_update
  50.   alias jens009_initialize_hud initialize
  51.   def initialize
  52.     # Initialize instances
  53.     @show_hud = true
  54.     @always_update = true
  55.     @refresh_hud = false
  56.     # Call default methods
  57.     jens009_initialize_hud
  58.   end
  59.   
  60. end

  61. #=============================================================================
  62. # Window Hud < Window_Base
  63. # Description: Handles Information to be shown in HUD
  64. #=============================================================================

  65. class Window_Hud < Window_Base
  66. #==========================
  67. # Initialize Values
  68. #==========================
  69.   def initialize
  70.     super(80,520,800,608)
  71.     self.opacity = 0
  72.     self.visible = false if $game_system.show_hud == false
  73.     refresh
  74.   end
  75. #=========================
  76. # Create Information
  77. #===========================
  78.   
  79.   def refresh
  80.     self.contents.clear
  81.     @item_max = JCONFIG::SHOW_MAX
  82.     @party_size = $game_party.members.size
  83.       for actor in $game_party.members
  84.         x = actor.index * 120
  85.         y = 0#actor.index * 80
  86.         if actor.index < @item_max
  87.           draw_actor_information(actor, x, y)
  88.         end
  89.       end
  90.     end
  91.   

  92.   
  93.   
  94.   def draw_actor_information(actor, x, y)
  95.     draw_actor_name (actor, x, y + 0)
  96.     draw_actor_graphic(actor, x + 15, y + 60)
  97.     draw_actor_hp_gauge(actor, x + 30, y + 20, 70)
  98.     draw_actor_mp_gauge(actor, x + 30, y + 30, 70)
  99.   end
  100.    
  101. #=================================  
  102. # Define Update
  103. #====================================
  104.   def update
  105.     refresh
  106.   end

  107. end
  108. #===============================
  109. # Start Scene_Map edit
  110. #===============================
  111. class Scene_Map
  112.   # Alias methods main, update and terminate
  113.   alias jens009_hud_main main
  114.   alias jens009_hud_update update
  115.   alias jens009_hud_terminate terminate
  116.   # Edit Main
  117.   def main
  118.     # Call HUD
  119.     @hud = Window_Hud.new
  120.     # Call previous Methods
  121.     jens009_hud_main
  122.   end

  123.   # Edit Update
  124.   def update
  125.     # Update hud only if $game_system.show_hud is true
  126.     if $game_system.show_hud and $game_system.always_update
  127.       @hud.update
  128.     end
  129.    
  130.     if $game_system.refresh_hud == true
  131.         @hud.update
  132.        $game_system.refresh_hud = false
  133.     end
  134.    
  135.     if $game_system.show_hud == true
  136.       @hud.visible = true
  137.     else
  138.       @hud.visible = false
  139.     end
  140.     # Call previous methods
  141.     jens009_hud_update
  142.   end
  143.   
  144.   

  145.   # Edit Terminate
  146.   def terminate
  147.     # Call previous methods, dispose of other windows first before HUD
  148.     jens009_hud_terminate
  149.     # Dispose HUD
  150.     @hud.dispose
  151.   end
  152.   
  153.   

  154.    
  155. #========================
  156. # End of Scene_Map edit
  157. #========================
  158. end
复制代码
试试这个能用否
74行处我改了坐标,你自己调一调���
作者: 四代天殇    时间: 2012-8-10 22:30
a364774426 发表于 2012-7-27 01:16
试试这个能用否
74行处我改了坐标,你自己调一调���


我大概看了一下这个代码,但是我没有看到 HUD的CLASS,于是我在这个脚本的前面加了$game_system.show_hud = false

但是测试时发现我的VX并没有SHOW_HUD的CLASS

所以我想这个脚本是不是建立在另外一个脚本上的?







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