Rectangle Width Property Delta Engine Documentation

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

public float Width { get; set; }

Property Value

Type: Single
Remarks

Tests: DeltaEngine.Tests.Datatypes.RectangleTests
Examples

3 unit tests call DeltaEngine.Datatypes.Rectangle.Width
[Test]
public void Create()
{
    var point = new Vector2D(2f, 2f);
    var size = new Size(1f, 1f);
    var rect = new Rectangle(point, size);
    Assert.AreEqual(point.X, rect.Left);
    Assert.AreEqual(point.Y, rect.Top);
    Assert.AreEqual(size.Width, rect.Width);
    Assert.AreEqual(size.Height, rect.Height);
    Assert.AreEqual(point, rect.TopLeft);
    Assert.AreEqual(size, rect.Size);
}
[Test]
public void ChangeValues()
{
    var rect = Rectangle.One;
    rect.Left = 2;
    rect.Top = 1;
    rect.Width = 2;
    rect.Height = 3;
    Assert.AreEqual(new Rectangle(2, 1, 2, 3), rect);
}
[Test]
public void Right()
{
    var rect = new Rectangle(1, 2, 10, 20) { Right = 13 };
    Assert.AreEqual(3, rect.Left);
    Assert.AreEqual(13, rect.Right);
    Assert.AreEqual(10, rect.Width);
}
See Also