I'm looking for a simple plugin that replaces the standard windows cursor with my png image.
Free for commercial use
Free for commercial use
/*:
* @target MZ
* @plugindesc Replace cursor with image.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/155619/
* @help Free to use and/or modify for any project, no credit required.
*/
void (() => {
// image location
const url = "./icon/icon.png";
// image anchor (px; default 0, 0)
const x = 0;
const y = 0;
// system cursor style to use if image fails to load (required)
const fallbackStyle = "pointer";
document.body.style.cursor = `url("${url}") ${x} ${y}, ${fallbackStyle}`;
})();
icon.png in the project's icon subfolder), anchored at its top-left corner (x = 0, y = 0). You can change those values in the code.
This seems to be a browser limitation. Make sure your cursor image is no larger than 32x32 px:
As I mentioned, you need to edit the code to change the image path - edit this line:
const url = "./icon/icon.png";
icon folder. E.g. to use cursor.png from the img/system subfolder: const url = "./img/system/cursor.png";
Original thread: https://forums.rpgmakerweb.com/threads/mz-mouse-system.155619/