Scene Controls Property Delta Engine Documentation

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

public List<Entity2D> Controls { get; }

Property Value

Type: List Entity2D 
Remarks

Tests: DeltaEngine.Scenes.Tests.SceneTests
Remarks

Tests: DeltaEngine.Scenes.Tests.AutoArrangingMenuTests
Examples

8 unit tests call DeltaEngine.Scenes.Scene.Controls
[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

3 unit tests call DeltaEngine.Scenes.Scene.Controls
[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