Polygon2D Points Property Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Shapes
Assembly: DeltaEngine.Rendering2D.Shapes (in DeltaEngine.Rendering2D.Shapes.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public List<Vector2D> Points { get; set; }

Property Value

Type: List Vector2D 
Remarks

Tests: DeltaEngine.Rendering2D.Graphs.Tests.GraphLineTests
Examples

3 unit tests call DeltaEngine.Rendering2D.Shapes.Polygon2D.Points
[Test, CloseAfterFirstFrame]
public void TwoPointsDrawALine()
{
    GraphLine line = CreateLineWithTwoPoints();
    Assert.AreEqual(2, line.points.Count);
    Assert.AreEqual(1, line.lines.Count);
    Line2D line2D = line.lines[0];
    Assert.IsTrue(line2D.StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f)));
    Assert.IsTrue(line2D.EndPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f)));
    Assert.AreEqual(LineColor, line.Color);
}
[Test, CloseAfterFirstFrame]
public void ClearRemovesAllLinesAndClearsAllPoints()
{
    GraphLine line = CreateLineWithTwoPoints();
    Line2D line2D = line.lines[0];
    Assert.IsTrue(line2D.IsActive);
    line.Clear();
    Assert.AreEqual(0, line.lines.Count);
    Assert.AreEqual(0, line.points.Count);
}
[Test, CloseAfterFirstFrame]
public void ChangeMaximumNumberOfPoints()
{
    Assert.AreEqual(0, graph.MaximumNumberOfPoints);
    graph.MaximumNumberOfPoints = 2;
    graph.MaximumNumberOfPoints = 2;
    Assert.AreEqual(2, graph.MaximumNumberOfPoints);
}
See Also