Line2D StartPoint 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 Vector2D StartPoint { get; set; }

Property Value

Type: Vector2D
Remarks

Tests: DeltaEngine.Rendering2D.Shapes.Tests.Line2DTests
Examples

19 unit tests call DeltaEngine.Rendering2D.Shapes.Line2D.StartPoint
[Test, CloseAfterFirstFrame]
public void CreateLine()
{
    var line = new Line2D(Vector2D.Zero, Vector2D.One, Color.Red);
    Assert.AreEqual(Vector2D.Zero, line.StartPoint);
    Assert.AreEqual(Vector2D.One, line.EndPoint);
    Assert.AreEqual(Color.Red, line.Color);
    Assert.AreEqual(2, line.Points.Count);
}
[Test, CloseAfterFirstFrame]
public void MoveLineViaItsEndPoints()
{
    var line = new Line2D(Vector2D.Zero, Vector2D.Zero, Color.Red)
    {
        StartPoint = Vector2D.Half,
        EndPoint = Vector2D.One
    };
    Assert.AreEqual(Vector2D.Half, line.StartPoint);
    Assert.AreEqual(Vector2D.One, line.EndPoint);
}
[Test, CloseAfterFirstFrame]
public void MoveLineByAssigningListOfPoints()
{
    var line = new Line2D(Vector2D.Zero, Vector2D.Zero, Color.Red);
    line.Points = new List<Vector2D> { Vector2D.Half, Vector2D.One };
    Assert.AreEqual(Vector2D.Half, line.StartPoint);
    Assert.AreEqual(Vector2D.One, line.EndPoint);
}
See Also