Scene ClassDelta Engine Documentation
Groups Entities such that they can be activated and deactivated together. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Content ContentData
    DeltaEngine.Scenes Scene
      Asteroids Game
      Blocks UserInterfaceLandscape
      Blocks UserInterfacePortrait
      Breakout Game
      Breakout MainMenu
      ComplexMenu Menu
      DeltaEngine.Scenes AutoArrangingMenu
      DeltaNinja.Pages BasePage
      FindTheWord GameScreen
      GameOfDeath UserInterface
      SideScroller Menu
      Snake Menu

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

public class Scene : ContentData

The Scene type exposes the following members.

Constructors

  NameDescription
Public methodScene 
Initializes a new instance of the Scene class
Protected methodScene(String)
Initializes a new instance of the Scene class
Top
Methods

  NameDescription
Public methodAdd(Entity2D)
Public methodAdd(IEnumerable Entity2D )
Public methodAddControlToScene
Public methodClear
Protected methodCreateDefault (Inherited from ContentData.)
Public methodDispose (Inherited from ContentData.)
Protected methodDisposeData (Overrides ContentData DisposeData .)
Public methodHide
Public methodInternalCreateDefault (Inherited from ContentData.)
Protected methodLoadData (Overrides ContentData LoadData(Stream).)
Public methodLoadFromFile
Public methodRemove
Public methodSetQuadraticBackground(String)
Public methodSetQuadraticBackground(Material)
Public methodSetViewportBackground(String)
Public methodSetViewportBackground(Material)
Public methodShow
Public methodToBackground
Public methodToForeground
Public methodToString (Inherited from ContentData.)
Top
Fields

  NameDescription
Protected fieldbackground
Protected fieldContentChanged (Inherited from ContentData.)
Top
Properties

  NameDescription
Protected propertyAllowCreationIfContentNotFound (Inherited from ContentData.)
Public propertyControls
Public propertyDrawArea
Public propertyIsDisposed (Inherited from ContentData.)
Public propertyMetaData (Inherited from ContentData.)
Public propertyName (Inherited from ContentData.)
Top
Remarks

Tests: DeltaEngine.Scenes.Tests.SceneTests
Examples

28 unit tests call DeltaEngine.Scenes.Scene
[Test, CloseAfterFirstFrame]
public void LoadSceneWithoutAnyControls()
{
    var loadedScene = ContentLoader.Load<Scene>("EmptyScene");
    Assert.AreEqual("EmptyScene", loadedScene.Name);
    Assert.AreEqual(0, loadedScene.Controls.Count);
}
[Test]
public void LoadSceneWithAButton()
{
    var loadedScene = ContentLoader.Load<Scene>("SceneWithAButton");
    Assert.AreEqual("SceneWithAButton", loadedScene.Name);
    Assert.AreEqual(1, loadedScene.Controls.Count);
    Assert.AreEqual(typeof(Button), loadedScene.Controls[0].GetType());
}
[Test, CloseAfterFirstFrame]
public void LoadSceneWithAButtonAndChangeTheMaterial()
{
    var loadedScene = ContentLoader.Load<Scene>("SceneWithAButtonWithChangedMaterial");
    Assert.AreEqual("SceneWithAButtonWithChangedMaterial", loadedScene.Name);
    Assert.AreEqual(1, loadedScene.Controls.Count);
    Assert.AreEqual(typeof(Button), loadedScene.Controls[0].GetType());
}
See Also