- Online Community Forums » Programming Questions » Resizing the game

This thread is locked; no one can reply to it. rss feed Print
Resizing the game
Member #16,069
September 2015

Hello, first i apologyze for my bad english.

I'm new in the allegro world, so i've some basic concepts about allegro programming.

My question is how to resize the game (images, sprites, etc..) depending of the resolution. I'm making a game in fullscreen using the flag ALLEGRO_FULLSCREEN_WINDOW, and the display gets the screen resolution, but the images don't change the size.

I really apreciate any help you can give me, i hope you understand my query ;D
I'm using allegro 5.0

Mark Oates
Member #1,146
March 2001

What I do is scale the entire surface using an ALLEGRO_TRANSFORM. The dead simplest way might be something like this:

al_scale_transform(&t, 3.0, 3.0); // scaled by 3

// now draw all your stuff, which will now be scaled

This method should work if you aren't using any other transforms in your code.

If you want the ALLEGRO_FULLSCREEN to match the native dimensions of your smaller window, then your scale would be screen_size_width/native_size_width.

Most likely you will find some tweaking will be necessary.

Member #16,069
September 2015

thanks for your quick response! I followed your advice and it worked perfectly, thank you very much for the help!! ;D


Go to: