BlocksContentTests ContentWithPrefixSet Method Delta Engine Documentation

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

public void ContentWithPrefixSet()
Examples

[Test, CloseAfterFirstFrame]
public void LoadContentWithPrefixSet()
{
    var content = new JewelBlocksContent { Prefix = "Mod1_" };
    var material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo");
    new Sprite(material, new Rectangle(0.3f, 0.45f, 0.1f, 0.1f));
    content.Prefix = "Mod2_";
    material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo");
    new Sprite(material, new Rectangle(0.6f, 0.45f, 0.1f, 0.1f));
}
[Test, CloseAfterFirstFrame]
public void ContentWithPrefixSet()
{
    var content = new JewelBlocksContent { Prefix = "FruitBlocks_" };
    var image = content.Load<Image>("Block1");
    Assert.IsTrue(image.PixelSize == new Size(4) || image.PixelSize == new Size(64) ||
        image.PixelSize == new Size(128));
    content.Prefix = "JewelBlocks_";
    image = content.Load<Image>("Block1");
    Assert.IsTrue(image.PixelSize == new Size(4) || image.PixelSize == new Size(64) ||
        image.PixelSize == new Size(128));
}
See Also