TheoAllen

Circular Test

May 4th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.66 KB | None | 0 0
  1. class Scene_Base
  2.  
  3.   alias circular_post_start post_start
  4.   def post_start
  5.     refresh_all_circular_info
  6.     circular_post_start
  7.   end
  8.  
  9.   def refresh_all_circular_info
  10.     instance_variables.each do |varname|
  11.       ivar = instance_variable_get(varname)
  12.       ox = Graphics.width / 2
  13.       oy = Graphics.height / 2
  14.       ivar.center_coordinate(ox,oy) if ivar.is_a?(Window)
  15.     end
  16.   end
  17.  
  18.   alias test_circular update
  19.   def update
  20.     test_circular
  21.     if Input.trigger?(:ALT)
  22.       instance_variables.each do |varname|
  23.         ivar = instance_variable_get(varname)
  24.         ivar.circle_move(360) if ivar.is_a?(Window)
  25.       end
  26.     end
  27.   end
  28.  
  29. end
Advertisement
Add Comment
Please, Sign In to add comment