Project1

标题: 窗口修改问题 [打印本页]

作者: 小小西    时间: 2017-11-1 19:28
标题: 窗口修改问题
帮忙修改显示窗口
修改效果:角色状态窗口生成效果 口口口口




RUBY 代码复制
  1. class Window_Simple_Status < Window_Base
  2.   #--------------------------------------------------------------------------
  3.   # ☆ オブジェクト初期化
  4.   #--------------------------------------------------------------------------
  5.   def initialize
  6.     y = 0
  7.     width = $game_party.members.size * 136
  8.     width = 136 if $game_party.members.size == 0
  9.     hight = MOTO::TP_GAGE ? 113 : 94
  10.     super(0, y, width, hight)
  11.     self.openness = 0
  12.     self.opacity = 255
  13.     refresh
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ☆ ウィンドウ内容の作成
  17.   #--------------------------------------------------------------------------
  18.   def create_contents
  19.     self.contents.dispose
  20.     self.contents = Bitmap.new((512 / 4 * $game_party.members.size), height - 32)
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ☆ リフレッシュ
  24.   #--------------------------------------------------------------------------
  25.   def refresh
  26.     create_contents
  27.     draw_contents
  28.     width_refresh
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ☆ ウィンドウ内容の描画
  32.   #--------------------------------------------------------------------------
  33.   def draw_contents
  34.     self.contents.clear
  35.     return if $game_party.members.size == 0
  36.     for i in 0...$game_party.members.size
  37.       actor = $game_party.members[i]
  38.       actor_x = i * 512 / 4
  39.       draw_actor_name(actor, actor_x, 0)
  40.       draw_actor_hp(actor, actor_x, 20)
  41.       draw_actor_mp(actor, actor_x, 40)
  42.       draw_actor_tp(actor, actor_x, 60) if MOTO::TP_GAGE
  43.     end
  44.   end






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