-
-
Notifications
You must be signed in to change notification settings - Fork 18
draw_triangle
Vašek edited this page Feb 9, 2019
·
3 revisions
Draws triangle with specified options
draw_triangle(t, outline, angle)
Argument | Description |
---|---|
Triangle t |
Positions of triangle corners |
bool outline |
Set outline on or off |
float angle |
Rotating triangle, not required |
Returns: void
|
draw_triangle(x1, y1, x2, y2, x3, y3, outline, angle)
Argument | Description |
---|---|
float x1 |
The X coordinate of the first corner |
float y1 |
The Y coordinate of the first corner |
float x2 |
The X coordinate of the second corner |
float y2 |
The Y coordinate of the second corner |
float x3 |
The X coordinate of the third corner |
float y3 |
The Y coordinate of the third corner |
bool outline |
Set outline on or off |
double angle |
Rotating triangle, not required |
Returns: void
|
draw_triangle(x1, y1, x2, y2, x3, y3, outline, angle)
Argument | Description |
---|---|
double x1 |
The X coordinate of the first corner |
double y1 |
The Y coordinate of the first corner |
double x2 |
The X coordinate of the second corner |
double y2 |
The Y coordinate of the second corner |
double x3 |
The X coordinate of the third corner |
double y3 |
The Y coordinate of the third corner |
bool outline |
Set outline on or off |
double angle |
Rotating triangle, not required |
Returns: void
|
This function will draw simple triangle in game.
Vector2 p1 = new Vector2(Position.X - 16, Position.Y + 16);
Vector2 p2 = new Vector2(Position.X + 16, Position.Y + 16);
Vector2 p3 = new Vector2(Position.X, Position.Y - 16);
Triangle t = new Triangle(p1, p2, p3);
draw_triangle(t, true, 120);
Draw triangle around the object and add some rotation.
draw_triangle(Position.X - 16, Position.Y + 16, Position.X + 16, Position.Y + 16, Position.X, Position.Y - 16, true);
This function will do the same thing as the previous example - only without rotation.
Back to Shapes