Slick2D - Zooming

Is there a way to zoom in with a factor 1.5 or so in Slick?
My game is supposed to be pixelated, without using large sprite :slight_smile:

yes, use g.scale(1.5f, 1.5f);

remember to use image.setFilter(Image.FILTER_NEAREST); since you want a pixelated look otherwise it’ll look blurry the closer you zoom in.

Whats “g” an instance of? Graphics?
Can I just put that in end of my rendering loop?

Thanks for the tip about setFilter too :smiley:

yes, g is the Graphics object provided by the render method.

and you’ll have to put it at the beginning of your rendering loop probably with a g.resetTransform() at the end of your rendering loop.

I’ve played with camera zooming in Slick2D as well. With parallax scrolling and tile mapping it becomes a little bit tricky because you’ve to recalculate the camera size with the current zoom factor.