Status
Not open for further replies.

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,362
Reaction score
1,854
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,550
Reaction score
16,091
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,228
Reaction score
6,007
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

Have you ever had the problem of not knowing how to name your game?
I tried to draw it to keep the aspect ratio of 48*48
It doesn't look good, but I'm not sure if there are other ways to render larger characters. and then maintain the sharpness or not
SF_Enemy1_6 added!
index.php

Just thought I'd share how my battlers are looking for my 4 main characters. From left to right... Ashlyn the brave fighter, Lizzabelle the peaceful mage, Suki the thief, Saedra the not-so-peaceful mage.

pLZHVLI.png
Power to the Game Make!

Forum statistics

Threads
118,782
Messages
1,118,661
Members
155,951
Latest member
SmectaMyLife
Top