Actually sprite positioning is done in two ways.

You can set the absolute rectangle of the sprite, i.e.:  rect(100,133, 150, 
229)

The rectangle has a left, top, right, and bottom coordinate, respectively.

Or, you can do it with the locH/locV.

If you use the locH, locV, what you are setting is where the sprite will be 
positioned relative to the regPoint of the castmember.

The regPoint, or registration point, is an "arbitrary" point in the 
graphic.  By default, it's set to the center of the graphic (use the 
regpoint tool in the paint window to see it - double click the regpoint 
tool to reset the regpoint to the center - the tool is the one that looks 
like a rifle-scope bullseye).  If you edited your graphic a number of times 
you might have shifted the regpoint which is why it might not seem to be 
exact center.

Imagine your graphic is 100x100.  So, if the regpoint is exact center, it 
will be at 50,50 in the castmember.

If you set the locH/locV to be, say, (310, 94) (you can also use 'the loc' 
to treat it as a point), what you are saying is, "put the graphic on the 
screen such that the regpoint will appear at (310, 94)".  Since YOUR 
regpoint is in the center, that means your graphic will be centered around 
310, 94.  Of course, if your regpoint was in the upper left corner of your 
graphic, then setting the locH/locV to 310,94 means that your graphic will 
be positioned such that the upper left corner is at 310,94, the rest of the 
graphic will be to the right and down.

Regpoints are used for complicated animations, such as a person walking, 
say, where the graphic might bounce up and down when you cycle through 
different graphics to do the effect.  If they all oriented to the upper 
left corner, you might not get the animation you want.  By default it 
orients through the center.

As far as you're concerned, if you correct the regpoint to be in the center 
(as described above by double-clicking the tool), you can use the loc 
property or locH/locV individually.  Or, if you prefer to just define the 
rectangle, you can set the rect of the sprite.  Either will work, as long 
as you pay attention to which coordinates you're using.

- Tab

At 09:06 AM 12/13/01 -0500, Jason Gruhl wrote:
>I've been trying to use the top property of a sprite. With this app
>when the user requests this sprite I then move it into the screen with
>lingo by changing the locV. The top property, however, does not change?
>Furthermore, I assumed that the locV and locH are in the middle of a
>given sprite. I have found that it tends to be a little off center?
>Has anyone run into these problems? I am trying to line up sprites
>relative to each other on the fly. Does anyone have a good technique?


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to