Status
Not open for further replies.

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,288
Reaction score
1,784
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi people!
I'm trying to achieve a way that will remove the smooth when stretching the image.

I'm making a game for mobile.
And in my tests, if I put the resolution to "any number 1104 x 720" The graphics look fine in several phones.
But the Rm Mv character looks really small using 720. I cannot change the character size because that would imply a lot of modifications in tilesets etc.
So, I tried to put it to a resolution smaller, like (1104 or 960) x 576.
And with both, the mobile phone stretches the screen making the fonts smooth and the tilesets and character too. But the size looks good!
Take a look:
AtFLssy.png

ONtOvyL.png

5Wjqfeo.png

9dVWoei.png

So, what can I do?
Any way to get around this?
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,525
Reaction score
16,000
First Language
Filipino
Primarily Uses
RMMZ
I could've sworn I added this to tips and tricks or js snippets but here you go.
Code:
//-----------------------------------------------------------------------------
// * Remove smoothing from graphics
//-----------------------------------------------------------------------------
Graphics._centerElement = function(element) {
    var width = element.width * this._realScale;
    var height = element.height * this._realScale;
    element.style.position = 'absolute';
    element.style.margin = 'auto';
    element.style.top = 0;
    element.style.left = 0;
    element.style.right = 0;
    element.style.bottom = 0;
    element.style.width = width + 'px';
    element.style.height = height + 'px';
    element.style["image-rendering"] = "pixelated";
    element.style["font-smooth"] = "none";
};
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,112
Reaction score
5,963
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

When can we get this?
RPG Maker MZ Saturn.png
Saturn port when?
I'm new to rpgmaker mv, link me some good stuff to learn.
Finally, I have graduated from college and now I can put a lot more work into my game, after having not worked on it for the better part of a year.
post so i can change my profile picture ^^
Creating Some art for a fighter game.

Forum statistics

Threads
117,068
Messages
1,104,279
Members
153,046
Latest member
peady
Top