Scene SetQuadraticBackground Method (String)Delta Engine Documentation

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

public void SetQuadraticBackground(
	string imageName
)
Remarks

Tests: DeltaEngine.Scenes.Tests.SceneTests
Examples

5 unit tests call DeltaEngine.Scenes.Scene.SetQuadraticBackground(System.String)
[Test, CloseAfterFirstFrame]
public void ChangeBackgroundImage()
{
    Assert.AreEqual(0, scene.Controls.Count);
    var background = new Material(ShaderFlags.Position2DColoredTextured,
        "SimpleMainMenuBackground");
    scene.SetQuadraticBackground(background);
    Assert.AreEqual(1, scene.Controls.Count);
    Assert.AreEqual(background, ((Sprite)scene.Controls[0]).Material);
    var logo = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo");
    scene.SetQuadraticBackground(logo);
    Assert.AreEqual(1, scene.Controls.Count);
    Assert.AreEqual(logo, ((Sprite)scene.Controls[0]).Material);
}
[Test]
public void BackgroundImageChangesWhenButtonClicked()
{
    scene.SetQuadraticBackground("SimpleSubMenuBackground");
    var button = CreateButton();
    button.Clicked += () => scene.SetQuadraticBackground("SimpleMainMenuBackground");
    scene.Add(button);
}
[Test]
public void SetQuadraticBackgroundOnSquareWindow()
{
    window.ViewportPixelSize = new Size(512, 512);
    scene.SetQuadraticBackground("CheckerboardImage512x512");
}
See Also