Sprite UV Property Delta Engine Documentation

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

public Rectangle UV { get; set; }

Property Value

Type: Rectangle
Remarks

Tests: DeltaEngine.Rendering2D.Tests.SpriteTests
Examples

4 unit tests call DeltaEngine.Rendering2D.Sprite.UV
[Test, ApproveFirstFrameScreenshot]
public void DrawModifiedUVSprite()
{
    var sprite = new Sprite(
        new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogoAlpha"),
        Rectangle.FromCenter(new Vector2D(0.5f, 0.5f), new Size(0.2f)));
    sprite.LastUV = sprite.UV = new Rectangle(0, 0, 0.5f, 0.5f);
}
[Test, CloseAfterFirstFrame]
public void AddingUVCalculatorResultsThrowsException()
{
    var sprite = new Sprite("DeltaEngineLogoAlpha", Rectangle.One);
    Assert.Throws<Sprite.RenderingDataComponentAddingIsNotSupported>(
        () => sprite.Add(new RenderingData()));
}
[Test]
public void SettingUVDoesNotSetLastUV()
{
    var sprite = new Sprite("DeltaEngineLogoAlpha", Rectangle.Zero) { UV = Rectangle.HalfCentered };
    Assert.AreEqual(Rectangle.One, sprite.LastUV);
}
See Also