じ☆ve冰风 发表于 2026-7-25 08:28:42

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;
    };
}




本贴来自国际rpgmaker官方论坛作者:Archeia处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/pixel-perfect-camera-plugin.181515/
页: [1]
查看完整版本: Pixel Perfect Camera Plugin