Namespace: DeltaEngine.Scenes
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Scenes.Tests.SceneTests
Tests: DeltaEngine.Scenes.Tests.AutoArrangingMenuTests
8 unit tests call DeltaEngine.Scenes.Scene.Controls
3 unit tests call DeltaEngine.Scenes.Scene.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: List Entity2DRemarks
Remarks
Examples
[Test, CloseAfterFirstFrame] public void LoadSceneWithoutAnyControls() { var loadedScene = ContentLoader.Load<Scene>("EmptyScene"); Assert.AreEqual("EmptyScene", loadedScene.Name); Assert.AreEqual(0, loadedScene.Controls.Count); }
[Test, CloseAfterFirstFrame] public void AddingControlAddsToListOfControls() { Assert.AreEqual(0, scene.Controls.Count); var control = new EmptyControl(); scene.Add(control); Assert.AreEqual(1, scene.Controls.Count); Assert.AreEqual(control, scene.Controls[0]); }
[Test, CloseAfterFirstFrame] public void RemovingControlRemovesFromListOfControls() { var label = new Sprite(material, Rectangle.One); scene.Add(label); scene.Remove(label); Assert.AreEqual(0, scene.Controls.Count); }
Examples
[Test, CloseAfterFirstFrame] public void ClearMenuOptionsLeavesOtherControlsAlone() { var logo = new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogo"); menu.Add(new Sprite(logo, Rectangle.One)); menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void MenuRenderLayerIsAppliedToControls() { menu.AddMenuOption(() => { });
[Test, CloseAfterFirstFrame] public void ChangingMenuRenderLayerChangesRenderLayerOfControls() { menu.AddMenuOption(() => { });
See Also