Sharp pixels when zooming / going full screen

orcomarcio

Veteran
Veteran
Joined
Nov 26, 2015
Messages
106
Reaction score
20
First Language
Italian
Hi,


 basically when i go in full screen mode i want the game not to be smoothed but instead i want the pixels to be "sharp". I know it should have something to do with the interpolation mode, which has to be set to NEAREST instead of LINEAR. I looked around in the internet on how to do that, expecially in PIXI forums but i had no luck so far. I tried to type this line andto put it i na plugin but it didnt' work.


PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;


Any ideas?
 

orcomarcio

Veteran
Veteran
Joined
Nov 26, 2015
Messages
106
Reaction score
20
First Language
Italian
After some long hours tring to put every scale mode to PIXI.scaleModes.NEAREST withour results, i thought i could be the html side of rpg maker that had the last word on how the game is rendered. So after some tries i found a way to modify the css style by code, basically i inserted a line in "Scene_Boot.prototype.start" but you can put it elsewhere it just has to be called after the graphics are initalized. This is the line


Graphics._canvas.style.imageRendering = "pixelated";


You can revert back to a linear scaling mode using this line


Graphics._canvas.style.imageRendering = "pixelated";


Graphics._canvas.style.imageRendering = "auto";




You can also put it as an ingame option without problem i guess. I don't know though if this method will work on android or iOs too
 

execexec

Warper
Member
Joined
Sep 11, 2016
Messages
2
Reaction score
0
Primarily Uses
Hi


Could You write more about this interpolation? I dont know where to put that code line you gaved in the post?


Graphics._canvas.style.imageRendering = "auto";


In what file and where exactly i need to put this line?


I also need sharp edges graphics.


Thanks for help!
 

orcomarcio

Veteran
Veteran
Joined
Nov 26, 2015
Messages
106
Reaction score
20
First Language
Italian
i think you can put it where you want it like you can make a plugin file just with that command but i'm not sure, i dont' know if the game has to do at elast 1 cycle before you can call that. In any case you can put it in Scene_Boot i think, something along this way


Scene_Boot.prototype.start = function() {
Scene_Base.prototype.start.call(this);
SoundManager.preloadImportantSounds();
if (DataManager.isBattleTest()) {
DataManager.setupBattleTest();
SceneManager.goto(Scene_Battle);
} else if (DataManager.isEventTest()) {
DataManager.setupEventTest();
SceneManager.goto(Scene_Map);
} else {
this.checkPlayerLocation();
DataManager.setupNewGame();
SceneManager.goto(Scene_Title);
Window_TitleCommand.initCommandPosition();
}
this.updateDocumentTitle();
Graphics._canvas.style.imageRendering = "pixelated"; // <------------- ADDED HERE
};


I didnt test it but it should work.


In any case if you want you can call this line through the editor script call, so you can put in in a common event.


At the moment i have a "plugin" of my own that holds like a initialization call and i put it there
 

execexec

Warper
Member
Joined
Sep 11, 2016
Messages
2
Reaction score
0
Primarily Uses
Yeah man! You are genious :)  Thanks a laot, it worked!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top