Page 1 of 1

Contact between two actors

PostPosted: Wed May 30, 2007 5:41 pm
by Troodon
Hi,
I just heard that GE can draw pixels. Is there a way to draw line between two of my actors?

PostPosted: Thu May 31, 2007 2:57 am
by Fuzzy
make a one pixel actor and use draw_from.

PostPosted: Thu May 31, 2007 2:58 am
by Sgt. Sparky
Fuzzy wrote:make a one pixel actor and use draw_from.

or just use a variable called Actor[2] (an array of 2 points, 0 and 1)
and use the linto or whatever. :D

PostPosted: Thu May 31, 2007 9:14 am
by Troodon
I think there is no draw_from function in my GE version so I will use the lineto.
Is it simple system?

PostPosted: Thu May 31, 2007 4:18 pm
by Sgt. Sparky
yes it is. :D

PostPosted: Thu May 31, 2007 4:45 pm
by Troodon
Can you tell me how it works? :)

PostPosted: Thu May 31, 2007 4:48 pm
by Sgt. Sparky
okay,
on the create actor event of the canvas:
setpen(the r value you want, the g value you want, the b value you want, the transparency, the size);
on the draw actor event of the canvas(make the canvas the size of the view and make sure the upper left corner of the canvas is touching the view.)
erase(0, 0, 0, 1);
moveto(Actor1.xscreen, Actor1.yscreen);
lineto(Actor2.xscreen, Actor2.yscreen);

:D
as simple as that.