Namespace: DeltaEngine.Scenes
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Scenes.Tests.SceneTests
5 unit tests call DeltaEngine.Scenes.Scene.SetQuadraticBackground(System.String)
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- imageName
- Type: System String
Remarks
Examples
[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