Rectangle GetRelativePoint Method Delta Engine Documentation

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

public Vector2D GetRelativePoint(
	Vector2D point
)

Return Value

Type: Vector2D
Remarks

Tests: DeltaEngine.Tests.Datatypes.RectangleTests
Examples

1 unit tests call DeltaEngine.Datatypes.Rectangle.GetRelativePoint(DeltaEngine.Datatypes.Vector2D)
[Test]
public void GetRelativePoint()
{
    var rect = new Rectangle(1, 2, 3, 4);
    Assert.AreEqual(Vector2D.Zero, rect.GetRelativePoint(new Vector2D(1, 2)));
    Assert.AreEqual(Vector2D.One, rect.GetRelativePoint(new Vector2D(4, 6)));
    Assert.AreEqual(new Vector2D(-1, -2), rect.GetRelativePoint(new Vector2D(-2, -6)));
}
See Also