I am using Yanfly Options Core and I want the player to be able to turn the following canvas render option on/off (I have a plugin that can change the fullscreen render option. I can manually change the render option by replacing "pixelated" with "auto" or disabling the plugin/ removing the line of code):
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
// I tried:
if ($gameVariables.value(28) === 1) {
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// i tried this too
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
if ($gameVariables.value(28) === 1) {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// this gave me the "null" error, because the variable was not declared when launching the game.
// i tried this too:
var render = 1;
if (var render === 1) {
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// That condition is wrong for some reason. Any help is appreciated. 🙂
link to the plugin: https://forums.rpgmakerweb.com/index.php?threads/pixel-perfect-scaling-mode.141354/
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
// I tried:
if ($gameVariables.value(28) === 1) {
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// i tried this too
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
if ($gameVariables.value(28) === 1) {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// this gave me the "null" error, because the variable was not declared when launching the game.
// i tried this too:
var render = 1;
if (var render === 1) {
Graphics.TDDP_updateCanvasImageRenderingMode = function() {
this._canvas.style.imageRendering = usePixelPerfectMode() ? 'pixelated' : '';
}
};
// That condition is wrong for some reason. Any help is appreciated. 🙂
link to the plugin: https://forums.rpgmakerweb.com/index.php?threads/pixel-perfect-scaling-mode.141354/