draw_triangle_colour

Draws a triangle of any shape and size, with separate colours assigned to each of its three corners.

Syntax:

GML Code Example

draw_triangle_colour(x1, y1, x2, y2, x3, y3, col1, col2, col3, outline);


Argument Description
x1 The x coordinate of the triangle's first corner.
y1 The y coordinate of the triangle's first corner.
x2 The x coordinate of the triangle's second corner.
y2 The y coordinate of the triangle's second corner.
x3 The x coordinate of the triangle's third corner.
y3 The y coordinate of the triangle's third corner.
col1 The colour of the first corner.
col2 The colour of the second corner.
col3 The colour of the third corner.
outline Whether the triangle is an outline (true) or filled in (false).


Returns: N/A


Description

With this function you can draw either an outline of a triangle or a filled triangle. If it is filled you can define the individual colours for each corner point and if these colours are not the same, you will get a gradient effect from one to the other (the colour settings will over-ride the base colour set with the function draw_set_colour).


Example:

GML Code Example

draw_triangle_colour(200, 200, 300, 200, 200, 300, c_red, c_blue, c_blue, false);

This would draw a filled isosceles right-angled triangle with red at the right angle, blue on the other two corners.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here