Mail Archives: djgpp/1998/05/11/05:06:18
>
>is there any way to center the screen in allegro? For example if my
>program was eunning in 320*240 and went up to 640*400 the screen would
>be up in the top left, any way to have it always centered in the middle?
>
>
>
In the example programs that come with Allegro, there are examples of this kind
of positioning....
let's say you had a 320x240 image, and you wanted in centered in 640x480
mode....
upper_left_corner_x=( screen->w - the_image->w) / 2;
upper_left_corner_y=( screen->h - the_image->h) / 2;
and then you'd just blit it...
Jim the loiterer
aloiterer AT juno DOT com
http://members.xoom.com/JimMcCue/index.htm
(Jim the loiterer's PC games, programming, & stuff...)
- Raw text -