Rectangle Move Method (Vector2D)Delta Engine Documentation

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

public Rectangle Move(
	Vector2D translation
)

Return Value

Type: Rectangle
Remarks

Tests: DeltaEngine.Tests.Datatypes.RectangleTests
Examples

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