Camera Mouse Movement

Camera Movement with Mouse
Version 1.1.1
By Magnus0808 || Magnus Rubin Peterson
​

Introduction
This plugin allows the player to move the camera using the mouse. When the cursor gets close the border of the screen then the camera will move in that direction.

I originally made this plugin as a request. However, some people have found it useful so I made an official thread for it.

Features
  • Camera movement using the mouse
  • Drag the camera using the middle mousebutton
  • (optional) Always show the player when they are moving
  • Turn the plugin on/off using Plugin Commands
How to use
Just plug and play.
However, you might want to change the plugin parameters to fit your preferences.
The following plugin command can be used to turn off/on the plugin:
CameraMouseMove On/Off/Toggle (depending on what you want)​
You can also turn off/on the dragging function:
CameraMouseMove On/Off/Toggle drag (depending on what you want)​

Download
You can download this plugin from my GitHub:
https://github.com/magnusrp0808/plugins/blob/master/MRP_CameraMouseMove.js

Terms of use
TERMS OF USE Copyright (c) 2020 Magnus0808 || Magnus Rubin Peterson || Magnusrp0808

  • You are free to use it in commercial or non commercial RPG Maker MV projects if you credit me unless other is stated.
  • Please do not change the header of the plugin
    • Other than that you are allowed to make edits to the plugin
  • You are NOT allowed to sell the plugin itself even if you edited it.
  • You can share the plugin with others but it is preferable you link either this thread or the github link.
Change log

Version 1.1.1:
+
Fixed so when you drag the camera and if the mouse gets within the boader then it will not start scrolling
Version 1.1:
+
Added dragging function to move the camera
Spoiler: Old entries
Version 1.0:
+ First Release


Author Notes
If you have any questions regarding this plugin then feel free to throw me a message.
It works like a dream! It's a pity that it doesn't seem to play nice with TDDP's Mouse Ex that enables custom cursors, though. I imagine because they both pertain to mouse function. *shrug*


Great plugin, otherwise! 🙂
@Twisted Crow I could only find one issue between the plugins which only happens when you have "Highlight On Hover" on in TDDP's Mouse Ex. However, this issue is fixed if you place my plugin AFTER TDDP_MouseSystemEx. (What happens is that TDDP_MouseSystemEx overwrites TouchInput._onMouseMove completely when "Highlight On Hover" is on.)

If this does not fix the issue you encountered then please write me the issues and I'll see if I can make them play nicely together 🙂
Yep. Works great after making that little adjustment! My thanks, Magnus!
Great plugin! Been looking for something like this for a while and it's great that it can be used with TDDP's Mouse EX! Would it be possible to also add a click and drag function to this?
@Creative Ed I added a dragging function to the plugin. You can now click and drag using the middle mousebutton 🙂
Awesome! This will be very useful!

EDIT: I tested it and there's just an issue. When Dragging with mid mouse button, if the mouse aproaches the borders it still moves the camera, which feels a bit odd (it executes the two movement types). Is it possible to disable the edge movement when the mid-mouse button is down?
@Creative Ed You're right that would feel weird. I have fixed it now, I also added so if you release the drag function within the boarder distance then it will not start moving until you remove the mouse from the boarder distance and back again. (since it would feel weird if the camera started moving in the opposite direction of what you just dragged) 🙂
This is great! Thank you 🙂 Sounds like it will work perfectly, I'll try it as soon as I get on my laptop!

Update: I tested it and it works perfectly, thank you for this plugin! 🙂
Is not working to me. Im using command PLugin: CameraMouseMove On Toggle drag
Is not working to me. Im using command PLugin: CameraMouseMove On Toggle drag

It sounds like you are not using the plugin command correctly:
  • CameraMouseMove On drag - To turn on the dragging feature
  • CameraMouseMove Toggle drag - To toggle the dragging feature (Turn it Off if it is On or On if it is Off)
I hope this will help 🙂
Thanks for the answer. I tried all the commands, but nothing happens. I turned off all plugins, but it still doesn't work.
ScreenHunter 132.png
If the dragging option was already On then the event you have there would turn it Off then after a second turn it On again. What exactly are you trying to do?

It should also be noted that you cannot move the camera outside the map, so if you can already see all of the map then it will not move the camera.
I just want drag the camera. The map i tested is big, so, i cannot see the entire map. This image is just an example. I tried everything: CameraMouseMove On drag, CameraMouseMove Toggle drag, and both as in image. Results is nothing Happens. I will try to create a new project. Thanks.
I created a new project and create a event with a command plugin and a map is big. Nothing happens 🙁
ScreenHunter 134.png
ScreenHunter 133.png
Can you show me the Console (Press F12 in game)?

Also you are aware that to drag the camera you have to press the middle mouse button?
Yes, i know about middle Button

1598725726419.png
Please try redownloading the plugin as it seems like the problem comes from a modified version of the plugin
I tried, but nothing happens. I also downloaded i plugin similar, called :

TTK - Draggable Camera (v1.1.4) but nothing happens 🙁
I tried, but nothing happens. I also downloaded i plugin similar, called :

TTK - Draggable Camera (v1.1.4) but nothing happens 🙁
Maybe you made a mistake while downloading it. Since according to the console there is a token '<' at line 6 which is not correct. Try this file.

Original thread: https://forums.rpgmakerweb.com/threads/camera-mouse-movement.117045/