The Daily Click ::. Forums ::. Klik Coding Help ::. Help needed
 

Post Reply  Post Oekaki 
 

Posted By Message

J.A.P

Possibly Insane

Registered
  11/06/2004
Points
  2048
10th November, 2004 at 14:58:10 -

How do I set the X and Y position of the object between two other objects?

 
Beware, be alert, prepare to defend yourself, or just run for your lives(!), because
JarmoNator has entered the building... (see avatar)
that dark human beast is almost unstoppable, invincible and totally gone CRAZY!

MrGrey



Registered
  27/10/2004
Points
  128
10th November, 2004 at 15:22:33 -

well if you have this:

(o) <--- object 1

.....(o) <---- middle object

..........(o) <------ object 2


set x position of middle object to (x position of object 1) + 1/2(difference between x position of object 2 and object 1)

repeate for y

I would... think that works... >_<

if you want want to change the positions of the object 1 and object 2, you might try using flags to show which one is first.


Image I never edited this. The guy below me is a liar.

Image Edited by the Author.

 
Everything's more dangerous from space.

J.A.P

Possibly Insane

Registered
  11/06/2004
Points
  2048
12th November, 2004 at 13:20:36 -

could you make an equation from that?

 
Beware, be alert, prepare to defend yourself, or just run for your lives(!), because
JarmoNator has entered the building... (see avatar)
that dark human beast is almost unstoppable, invincible and totally gone CRAZY!

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
12th November, 2004 at 14:20:50 -

Set X position to (X position of Object 1 + X position of Object 2) / 2
Set Y position to (Y position of Object 1 + Y position of Object 2) / 2

 
a/n

MrGrey



Registered
  27/10/2004
Points
  128
12th November, 2004 at 18:09:51 -

Actually, i tried to test this after i posted, and sadly it bugs up. I think it has to do with the fact that you cant set an objects coordinates to fractions of pixles.

 
Everything's more dangerous from space.

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
13th November, 2004 at 07:18:44 -

Its quite simple, just think of it as the average of the X positions and the average of the Y positions. You could set it in the middle of 3 objects by:
(Object1 X + Object2 X + Object3 X) / 3
etc.

 
- Tigerworks

J.A.P

Possibly Insane

Registered
  11/06/2004
Points
  2048
13th November, 2004 at 14:35:24 -

thanks!

 
Beware, be alert, prepare to defend yourself, or just run for your lives(!), because
JarmoNator has entered the building... (see avatar)
that dark human beast is almost unstoppable, invincible and totally gone CRAZY!
   

Post Reply



 



Advertisement

Worth A Click