"Scaling" Your Images to Fix Screen Size

I hope the title makes sense with what I’m trying to accomplish.

My goal is to create tile maps for a top-down RPG using 32 x 32 tiles. When I display the tiles in an 800 x 648 screen, I lose the look that I’m going for. I want everything to appear bigger.

I’m having a hard time explaining it and wrapping my head around it, but I’d like the tiles to use 32 x 32 pixels, but for them to fit into a bigger size, say 64 x 64.

If this doesn’t make sense, I’ll try to figure out a way to explain it better, but if anyone actually knows what I’m trying to do, guidance in the right direction would be great. Thanks

If you’re looking for that “blocky big pixel” look, set your texture magnification filter to GL_NEAREST and you’ll be all set.

I have no idea what you are talking about… very new to programming.

Are you using LWGJL?

I heard you were talking about Notch’s ludum dare, are you perhaps trying to figure out what/how he’s doing that blocky scaling?

I’m not using any API. He did use something that probably got the same effect I’m looking for.

IIRC Notch fiddles around with the raster ( array of pixels ) and just scales the image, i.e, draws the image stretched (larger than it actually is).

[EDIT]: So basically:

int scale = 2; // twice the size
int ww = width * scale;
int hh = height * scale;

g.drawImage(x,y, ww, hh, null);

Heh, that makes so much sense…

I’ll fiddle around with it. That definitely puts me in the right direction though. Thanks

A workaround to this is to load the image, scale it, and store it into a object. Then you draw from it.
Scaling the image every time you draw it is way too slow

That’s assuming that the thing he wants scaled is a single image that never changed. For something like the game screen you’d need to re-scale it every frame.

Scaling the image every time you draw isn’t as slow as you might think. Certainly not as slow as you make it sound :}

Of course, depends a LOT on the size of the image.

Maybe, i’m a bit of a performance paranoid person ;D

And it also depends on how much you want to scale as well
I remember scaling a 24x24 tile to 480x480, 600fps dropped down to ~10

I have rarely ever seen a major performance hit from scaling. My particles for example change size every frame and scale from sometimes very large or small sizes and I don’t drop fps unless there are 1k+ particles. I would still stay away from scaling things to much even though I don’t see a any drops it is good practice.