Script Scroll camera on map! v 1.5

Scroll CameraVersion: 1.5
By: Falcao

Introduction

Here a script that allow you to scroll the game camera wherever you like just by pressing the directional arrows

Features

- By pressing "A" (by defaut) call the camera
- allow you move the camera wherever you like
- work like a minimap script also.
- You can see the arrows icon on map with zoom
- Easy to use

Instructions

Copy and paste the script to your project, YEAH! very esasy i think.


Compatibility

This script work perfectly with others scripts system like XAS HERO
Compatibility thank to the alias method


Credits

By Falcao


Script

  1.  
  2. #==================================================================#
  3. #==================================================================#
  4. #  #*****************#        Scroll camera v1.5 Falcao script     #
  5. #  #*** By Falcao ***#        allow you move the game camera       #        
  6. #  #*****************#        with the directional keys            #
  7. #         RMXP                                                     #
  8. # makerpalace.onlinegoo.com         V 1.5                          #
  9. #==================================================================#
  10.  
  11. module Camara
  12.  
  13. # Button to run the script (Key "A" of the keyboard)
  14. Button = Input::X  
  15.  
  16. # Speed of the camera (set 1 until 10)
  17. Speed = 5
  18.  
  19. #Switch to disable or enable the script (on, off)
  20. CamaraDisable = 50
  21.  
  22. end
  23.  
  24. $xrxs = {} if $xrxs == nil
  25.  
  26. class Game_System
  27.   attr_accessor :camara
  28.   alias falcaoscroll_initialize initialize
  29.   def initialize
  30.     falcaoscroll_initialize
  31.     @camara = false
  32.   end
  33. end
  34.  
  35. class Active_Arrow
  36.   def initialize
  37.     @arrow_up = Sprite.new
  38.     @arrow_up.bitmap = RPG::Cache.icon("047-Skill04")
  39.     @arrow_up.x = 325
  40.     @arrow_up.y = 40
  41.     @arrow_up.z = 200
  42.     @arrow_up.angle = 180
  43.     @arrow_up.visible = false
  44.    
  45.     @arrow_left = Sprite.new
  46.     @arrow_left.bitmap = RPG::Cache.icon("047-Skill04")
  47.     @arrow_left.x = 32
  48.     @arrow_left.y = 220
  49.     @arrow_left.z = 200
  50.     @arrow_left.angle = 270
  51.     @arrow_left.visible = false
  52.    
  53.     @arrow_down = Sprite.new
  54.     @arrow_down.bitmap = RPG::Cache.icon("047-Skill04")
  55.     @arrow_down.x = 316
  56.     @arrow_down.y = 446
  57.     @arrow_down.z = 200
  58.     @arrow_down.visible = false
  59.    
  60.     @arrow_right = Sprite.new
  61.     @arrow_right.bitmap = RPG::Cache.icon("047-Skill04")
  62.     @arrow_right.x = 600
  63.     @arrow_right.y = 242
  64.     @arrow_right.z = 200
  65.     @arrow_right.angle = 90
  66.     @arrow_right.visible = false
  67.   end
  68.   def update
  69.      if $game_system.camara == true
  70.      case Input.dir4
  71.      when 2
  72.       @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
  73.       @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
  74.       @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
  75.       @arrow_down.zoom_x = 1.4; @arrow_down.zoom_y = 1.4
  76.      when 4
  77.        @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
  78.       @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
  79.       @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
  80.        @arrow_left.zoom_x = 1.4; @arrow_left.zoom_y = 1.4
  81.      when 6
  82.        @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
  83.       @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
  84.       @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
  85.        @arrow_right.zoom_x = 1.4; @arrow_right.zoom_y = 1.4
  86.      when 8
  87.       @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
  88.       @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
  89.       @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
  90.       @arrow_up.zoom_x = 1.4; @arrow_up.zoom_y = 1.4
  91.     end
  92.     @arrow_up.visible = true
  93.       @arrow_left.visible = true
  94.       @arrow_down.visible = true
  95.       @arrow_right.visible = true
  96.     else
  97.       @arrow_up.visible = false
  98.       @arrow_left.visible = false
  99.       @arrow_down.visible = false
  100.       @arrow_right.visible = false
  101.      end
  102.   end
  103.   def dispose
  104.     @arrow_up.dispose
  105.     @arrow_up.bitmap.dispose
  106.     @arrow_left.dispose
  107.     @arrow_left.bitmap.dispose
  108.     @arrow_down.dispose
  109.     @arrow_down.bitmap.dispose
  110.     @arrow_right.dispose
  111.     @arrow_right.bitmap.dispose
  112.   end
  113. end
  114.  
  115. class Game_Player < Game_Character
  116.   include Camara
  117.   alias falcaocamara_update update
  118.   def update
  119.     falcaocamara_update
  120.       if Input.trigger?(Button) and @camera_action == nil and
  121.         $game_switches[CamaraDisable] == false
  122.         if $xrxs["xas"] == true
  123.         $game_switches[6] = true
  124.         $game_map.refresh
  125.       end
  126.       @walk_anime = false
  127.       $game_system.camara = true
  128.       @camera_action = 1
  129.     elsif Input.trigger?(Button) and @camera_action == 1 and
  130.       $game_switches[CamaraDisable] == false
  131.       center(x, y)
  132.       if $xrxs["xas"] == true
  133.         $game_switches[6] = false
  134.         $game_map.refresh
  135.       end
  136.       @move_speed = 4
  137.       @walk_anime = true
  138.       $game_system.camara = false
  139.       @camera_action = nil
  140.     end
  141.     if $game_system.camara == true
  142.       @move_speed = -20
  143.     unless $game_temp.message_window_showing
  144.       case Input.dir4
  145.       when 2
  146.         turn_down
  147.         $game_map.start_scroll(2, 1,Speed)
  148.       when 4
  149.         turn_left
  150.         $game_map.start_scroll(4, 1,Speed)
  151.       when 6
  152.         turn_right
  153.         $game_map.start_scroll(6, 1,Speed)
  154.       when 8
  155.         turn_up
  156.         $game_map.start_scroll(8, 1,Speed)
  157.       end
  158.     end  
  159.   end
  160. end
  161. end
  162.  
  163. class Scene_Map
  164.   alias falcaoscroll_main main
  165.   def main
  166.     @arrow_active = Active_Arrow.new
  167.     falcaoscroll_main
  168.     @arrow_active.dispose
  169.   end
  170.   alias falcaoscroll_update update
  171.   def update
  172.     @arrow_active.update
  173.     falcaoscroll_update
  174.   end
  175. end
  176.  
Expand to see the code.
@falcao - I really like this script!

the new version runs real smooth and now it has a switch setting! right ON!!
great work on this... ~g/A\/\/\|E|F/A\(C|=
This script looks really cool! I might actually use this one.
This is awesome! Do you think you can make this for VX?
Rpg maker vx version come the next week

Be patient.

Thank for comments!
falcao wrote:
Rpg maker vx version come the next week

Be patient.

Thank for comments!

Glad to hear! Can't wait to see it! :D
Great scripts! Works awesomely, except that the character follows the scroll... =(

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=67127