delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/22/09:54:37

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE35793DE@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: HELP : Scaling
Date: Mon, 22 Feb 1999 14:52:50 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019