How to draw straight lines and rectangles?

Non-platform specific questions.

How to draw straight lines and rectangles?

Postby BloodRedDragon » Tue Feb 10, 2009 4:01 pm

I was wondering how you would allow the user to draw straight lines and rectangles/circles inside a canvas actor in game. Does anyone know? I know how to allow the user to just draw freehand, but that's about it. :?
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re: How to draw straight lines and rectangles?

Postby DST » Tue Feb 10, 2009 4:07 pm

erase(255,255,255,1);
setpen(255,0,0,0,3);
moveto(0, 0);
lineto(100, 100);


moveto(200,200);
lineto(250, 200);
lineto(250,250);
lineto(200, 250);
lineto(200, 200);
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: How to draw straight lines and rectangles?

Postby BloodRedDragon » Tue Feb 10, 2009 4:42 pm

aah. Thanks DST!
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron