MaterialTests LoadSavedMaterialWithPadding Method Delta Engine Documentation

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

public void LoadSavedMaterialWithPadding()
Examples

[Test, CloseAfterFirstFrame]
public void LoadSavedMaterialWithPadding()
{
    var loadedMaterial = ContentLoader.Load<Material>("DefaultMaterial");
    loadedMaterial.RenderingCalculator = new RenderingCalculator(new AtlasRegion
    {
        PadLeft = 0.5f,
        PadRight = 0.5f,
        PadTop = 0.5f,
        PadBottom = 0.5f,
        IsRotated = false
    });
    RenderingData result = loadedMaterial.RenderingCalculator.GetUVAndDrawArea(
        Rectangle.HalfCentered, Rectangle.One);
    Assert.AreEqual(result.RequestedUserUV, Rectangle.HalfCentered);
}
See Also