Mail Archives: djgpp/1999/02/22/09:54:37
Lee writes:
> hi, i have a question regarding scaling in allegro. how do i make an
> "object" shrink or stretch while keeping it at its original position?
Just move the x/y position where you draw it to wherever you like, so
that the centre of the object will stay in the same place.
For example if you had a graphics sized w,h, which you wanted to draw
centered on the spot x,y, you would draw it at x-w/2, y/h/2, right?
So when you change your w and h values, just recalculate x-w/2 to
work out a new top left corner...
Shawn Hargreaves.
- Raw text -