Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Geom
/
Triangle
Phaser 4.1.0
Phaser 4 examples
Triangle
32
examples
Examples
32
Build Equilateral Triangle
Demonstrates how to create a geometrically perfect equilateral triangle by specifying a starting point and the length of its sides.
Clone a Triangle
Demonstrates how to use the Clone method to create duplicates of a Triangle geometry object.
Create Triangle
Learn how to define a geometric triangle and render it as a filled shape using the Graphics object.
Right-Angled Triangle
Demonstrates how to create a right-angled triangle geometry object by specifying its position, width, and height.
Rotate Triangle Around a Point
Demonstrates how to rotate a triangle geometry object around a specific X and Y coordinate.
Rotate Triangle Around Center
Demonstrates how to rotate a Triangle geometry object around its own center point and render the results using Graphics.
Rotate Triangle Around Point
Demonstrates how to rotate a triangle shape around various geometric anchor points, including the centroid, circumcenter, incenter, and specific vertices.
Triangle Area
Calculate and display the area of a Triangle geometry object as its vertices are modified by the mouse pointer.
Triangle Bottom
Demonstrates using the bottom property to get or set the vertical position of the lowest point of a Triangle geometry object.
Triangle Center On
Demonstrates using the CenterOn function to position a geometric triangle by its center point as it follows the mouse pointer.
Triangle Centroid
Calculate and visualize the geometric center (centroid) of a triangle by drawing lines from each vertex to the center point.
Triangle Circumcenter
Calculate and visualize the circumcenter and circumcircle of a triangle geometry object.
Triangle Circumcircle
Calculate and render a circle that passes through all three vertices of a Phaser Triangle geometry object.
Triangle Contains Array
Demonstrates how to use the Triangle.ContainsArray method to filter an array of points and identify which ones fall within the area of a specific Triangle geometry.
Triangle Contains Point
Demonstrates using the Triangle Contains function to check if a moving point is located within the area of a rotating triangle.
Triangle Contains Point
Checks if the mouse pointer is inside a geometric triangle and changes the shape's color based on the result.
Triangle Copy From
Learn how to duplicate geometry data between triangles using the CopyFrom method to create a trail of shapes that follow the pointer.
Triangle Decompose
Extract the vertices of a triangle into an array of points to create complex visual patterns or path data.
Triangle Edges
Learn how to retrieve the individual line segments that form the three sides of a Triangle geometry object using getLine methods.
Triangle Equals
Demonstrates how to use the Triangle.Equals method to check if two triangle shapes have identical vertex coordinates.
Triangle Get Point
Demonstrates how to use the getPoint method to calculate a specific coordinate along the perimeter of a Triangle shape.
Triangle Get Points
Demonstrates how to retrieve an array of points evenly distributed along the perimeter of a triangle shape.
Triangle Get Random Point
Demonstrates how to use the getRandomPoint method to pick random coordinates located within the area of a Triangle geometry shape.
Triangle Incenter
Calculates the incenter of a triangle and visualizes it by drawing lines from each vertex to the center point.
Triangle Left Property
Demonstrates moving a triangle geometry object horizontally by modifying its left property.
Triangle Offset
Demonstrates how to move a Triangle shape by specific x and y values using the Offset function to create geometric patterns.
Triangle Perimeter
Calculate and display the perimeter of a Triangle shape as one of its points moves with the pointer.
Triangle Random Points
Demonstrates how to generate and plot random points inside the area of a Triangle geometry object.
Triangle Right Property
Demonstrates how to use and modify the right property of a Triangle geometry object to reposition it based on its rightmost bounds.
Triangle Set To
How to update all six coordinates of a Triangle geometry object simultaneously using the setTo method.
Triangle Top Property
Demonstrates how to use the top property of a Triangle geometry object to adjust its vertical position.
Triangulate Polygon
Decompose an array of polygon coordinates into a series of triangle objects using the BuildFromPolygon utility.