Pixel Perfect Camera Plugin

Pixel Perfect Camera Plugin Version 1.0
Iris to Id
​

Introduction
Enable or disable pixel perfect camera mode

Features
This plugin is made to remove Pixel Art Tiles Jitter and Blur During Movement.
Original Request Topic here: https://forums.rpgmakerweb.com/inde...and-blur-during-movement.181501/#post-1541051

How to Use
Install. Enable.

Download
Code:
/*:
/*:
 * @target MZ
 * @plugindesc Pixel Perfect Camera
 * @author Iris to Id
 * @url https://iristoid.itch.io/
 *
 * @param enabled
 * @text Enable Pixel Perfect
 * @type boolean
 * @default true
 * @desc Enable or disable pixel perfect camera mode
 *
 * @help PixelPerfectCamera.js
 *
 * This plugin is made to remove Pixel Art Tiles Jitter 
 * and Blur During Movement.
 *
 * Terms of Use:
 * Free for use in commercial and non-commercial projects.
 * Credit appreciated.
 */

const pluginName = "PixelPerfectCamera";
const parameters = PluginManager.parameters(pluginName);
const pixelPerfectEnabled = parameters['enabled'] === 'true';

if (pixelPerfectEnabled) {
    // Override PIXI updateTransform to round positions before rendering
    const _Tilemap_updateTransform = Tilemap.prototype.updateTransform;
    Tilemap.prototype.updateTransform = function() {
        const saveOriginX = this.origin.x;
        const saveOriginY = this.origin.y;
        this.origin.x = Math.round(this.origin.x);
        this.origin.y = Math.round(this.origin.y);
        _Tilemap_updateTransform.call(this);
        this.origin.x = saveOriginX;
        this.origin.y = saveOriginY;
    };

    const _Sprite_updateTransform = Sprite.prototype.updateTransform;
    Sprite.prototype.updateTransform = function() {
        const saveX = this.x;
        const saveY = this.y;
        this.x = Math.round(this.x);
        this.y = Math.round(this.y);
        _Sprite_updateTransform.call(this);
        this.x = saveX;
        this.y = saveY;
    };
}
Hi, thank you for the amazing plugin. I’ve been testing it in my project and it works great overall.

However, I encountered a bug when I used it alongside a pixel movement plugin. When I used it, my events begin to “vibrate” or jitter when I moved diagonally.

Could you let me know how I may fix this? For reference, I am using San Analog Move for pixel-based movement.

Here's the result in a clean project using only the San Analog Move and Pixel Perfect Camera plugins.

Original thread: https://forums.rpgmakerweb.com/threads/pixel-perfect-camera-plugin.181515/