Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Game Help (Triangles)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Spence607




PostPosted: Mon Jan 05, 2009 7:23 pm   Post subject: Game Help (Triangles)

Just wondering if anyone knew of a way to draw triangles in Turing, I can't seem to find a way myself.

I need it for this:


Posted Image, might have been reduced in size. Click Image to view fullscreen.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Mon Jan 05, 2009 7:25 pm   Post subject: RE:Game Help (Triangles)

Do you know how to draw lines? Then you can draw a triangle. Write a function to draw a triangle even. I see dozens of triangles already drawn on your picture.
Laplace's Demon




PostPosted: Mon Jan 05, 2009 7:28 pm   Post subject: Re: Game Help (Triangles)

You have to use Draw.Polygon or Draw.FillPolygon.

Go check them out in the turing reference, basically you just create arrays which store multiple x and y values into a single variable, and use those arrays to create any number of points. In your case you will want to use 3 different points.

EDIT: You could just use lines if you only want to create an outline, but if you want to create different colors inside the triangle you will want to use the Draw.FillPolygon procedure.
Spence607




PostPosted: Mon Jan 05, 2009 7:35 pm   Post subject: Re: RE:Game Help (Triangles)

insectoid @ Mon Jan 05, 2009 7:25 pm wrote:
Do you know how to draw lines? Then you can draw a triangle. Write a function to draw a triangle even. I see dozens of triangles already drawn on your picture.


Yes, I could use lines, but then to fill in the triangle I would also have to use lines, which would take forever, and alright Laplace's Demon, I'll check out Polygon's.
Insectoid




PostPosted: Mon Jan 05, 2009 7:45 pm   Post subject: RE:Game Help (Triangles)

Spence, you could use Draw.Fill to fill in the triangle. But then, Draw.Polygon would work better.
Spence607




PostPosted: Mon Jan 05, 2009 7:52 pm   Post subject: Re: Game Help (Triangles)

Polygons rule! Thanks for the help.

Posted Image, might have been reduced in size. Click Image to view fullscreen.
corriep




PostPosted: Tue Jan 06, 2009 9:35 pm   Post subject: RE:Game Help (Triangles)

PS, The game UI is looking really good!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: