Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #==============================================================================
  2. # ■ Map Scrolling Expansion
  3. # By :VIPArcher [email: VIPArcher@sina.com]
  4. #  -- The script comes from http://rm.66rpg.com Please keep the information above.
  5. #  Feel free to use/ reprint
  6. #==============================================================================
  7. # Description:
  8. #    For the event, call start_scroll(direction, distance, speed) to scroll map
  9. #    direction:  7  8  9     distance: scroll distance
  10. #                 ↖↑↗            speed: scroll speed 1 - 6
  11. #                4← →6           1:  1/8x slow; 2:  1/4x slow
  12. #                 ↙↓↘            3:  1/2x slow; 4:  normal speed
  13. #                1  2  3           5:    2x fast; 6:  4x fast
  14. #    If you move diagonally to edge, it will turn horizontally.
  15. #==============================================================================
  16. $VIPArcherScript ||= {};$VIPArcherScript[:map_scroll] = 20150503
  17. #==============================================================================
  18. class Game_Interpreter
  19.   #--------------------------------------------------------------------------
  20.   # ● start_scroll(direction, distance, speed)
  21.   #   direction scroll direction (1-9)
  22.   #   distance  scroll distance (# of cells)
  23.   #   speed     scroll speed (1-6)
  24.   #--------------------------------------------------------------------------
  25.   def start_scroll(direction, distance, speed)
  26.     Fiber.yield while $game_map.scrolling?
  27.     $game_map.start_scroll(direction, distance, speed)
  28.   end
  29. end
  30. #==============================================================================
  31. class Game_Map
  32.   #--------------------------------------------------------------------------
  33.   # ● Start scrolling
  34.   #--------------------------------------------------------------------------
  35.   alias do_scroll_dir8_extra do_scroll
  36.   def do_scroll(direction, distance)
  37.     do_scroll_dir8_extra(direction, distance)
  38.     case direction
  39.     when 1;  scroll_down (distance);scroll_left (distance)
  40.     when 3;  scroll_down (distance);scroll_right(distance)
  41.     when 7;  scroll_up   (distance);scroll_left (distance)
  42.     when 9;  scroll_up   (distance);scroll_right(distance)
  43.     else end
  44.   end
  45. end