Page 1 of 1

line to

PostPosted: Fri Feb 22, 2008 3:21 pm
by Kalladdolf
now does anybody know how to simply draw a line from one actor to another?
Since I got con-fuzzled with the canvas stuff, I can't figure it out :oops:

Re: line to

PostPosted: Sat Feb 23, 2008 12:32 am
by makslane
Try a code like this:

Code: Select all
int xc, yc;

//Clear the screen
erase(0, 0, 0, 0);
setpen(255, 253, 251, 0, 1);

//From actor1
xc = player.xscreen;
yc = player.yscreen;
screen_to_actor(&xc, &yc);
moveto(xc, yc);

//To actor2
xc = player2.xscreen;
yc = player2.yscreen;
screen_to_actor(&xc, &yc);
lineto(xc, yc);

Re: line to

PostPosted: Sat Feb 23, 2008 8:51 am
by Kalladdolf
thank you very much,
happy birthday btw =D

Re: line to

PostPosted: Sat Feb 23, 2008 1:53 pm
by j2graves
you could also try using bee-ant's shadow effect. btw, did I miss Makslane's birthday? HAPPY BIRTHDAY MAKSLANE!!!!!!!!!!!

Re: line to

PostPosted: Tue Feb 26, 2008 9:36 am
by Kalladdolf
there are 2 problems with the code, unfortunately:
1st, the screen behind the canvas actor goes all black
2nd, the computer starts going slowly when I let the canvas actor have the size of the screen (and move the two connected actors)

Re: line to

PostPosted: Tue Feb 26, 2008 10:14 am
by DilloDude
To stop it going all black, put in some transparency when erasing:
Code: Select all
erase(0, 0, 0, 1);

Re: line to

PostPosted: Tue Feb 26, 2008 11:01 am
by Kalladdolf
thankz

Re: line to

PostPosted: Fri Feb 29, 2008 11:00 am
by thunderios
I've managed to create some sort of line. Since I'm a beginner it isn't amazing but it does what it's supposed to do. But you cant draw two lines at a time and the can only go like 1-2-3-4 not 1-2 3-4, you get me?

This is my first upload and I don't know if I've done it the right way -.-'
OK u need to place 'stip' (which means dot in Dutch) in a folder called 'data' which you have to make yourself ;) then it'll work.
Oh you need a program called Game Editor too

Re: line to

PostPosted: Fri Feb 29, 2008 3:52 pm
by Kalladdolf
after a bit of experimenting, I found it out myself.
Thanks for your willingness to help, though!
:D