Entity2DTests SetDrawAreaProperties Method Delta Engine Documentation

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

public void SetDrawAreaProperties()
Examples

[Test]
public void SetDrawAreaProperties()
{
    var entity = new Entity2D(Rectangle.One)
    {
        Color = Color.Blue,
        Center = Vector2D.One,
        Size = new Size(2)
    };
    Assert.AreEqual(DoubleSizedRectangle, entity.DrawArea);
    entity.DrawArea = new Rectangle(-1, -1, 2, 2);
    Assert.AreEqual(Vector2D.Zero, entity.Center);
    entity.TopLeft = Vector2D.Zero;
    Assert.AreEqual(Vector2D.Zero, entity.TopLeft);
    Assert.AreEqual(DoubleSizedRectangle, entity.DrawArea);
}
See Also