fork download
  1. #==============================================================================
  2. # ■ Window_Test
  3. #==============================================================================
  4. class Window_Test < Window_Base
  5. #--------------------------------------------------------------------------
  6. # ● オブジェクト初期化
  7. #--------------------------------------------------------------------------
  8. def initialize
  9. super(Graphics.width - window_width, Graphics.height - fitting_height(1),
  10. window_width, fitting_height(1))
  11. @mg = 0
  12. @mg_max = 0
  13. refresh
  14. end
  15. #--------------------------------------------------------------------------
  16. # ● ウィンドウ幅の取得
  17. #--------------------------------------------------------------------------
  18. def window_width
  19. return 160
  20. end
  21. #--------------------------------------------------------------------------
  22. # ● フレーム更新
  23. #--------------------------------------------------------------------------
  24. def update
  25. super
  26. if (@mg != $game_variables[10]) || (@mg_max != $game_variables[11])
  27. @mg = $game_variables[10]
  28. @mg_max = $game_variables[11]
  29. refresh
  30. end
  31. end
  32. #--------------------------------------------------------------------------
  33. # ● リフレッシュ
  34. #--------------------------------------------------------------------------
  35. def refresh
  36. contents.clear
  37. draw_text(contents.rect, "#{@mg}/#{@mg_max}", 1)
  38. end
  39. end
  40.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty