Scene Hide Method Delta Engine Documentation

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

public void Hide()
Remarks

Tests: DeltaEngine.Scenes.Tests.SceneTests
Examples

3 unit tests call DeltaEngine.Scenes.Scene.Hide
[Test, CloseAfterFirstFrame]
public void AddingControlToInactiveSceneDeactivatesIt()
{
    var label = new Sprite(material, Rectangle.One) { IsActive = true };
    scene.Hide();
    scene.Add(label);
    Assert.IsFalse(label.IsActive);
}
[Test, CloseAfterFirstFrame]
public void HidingSceneHidesControls()
{
    var label = new Sprite(material, Rectangle.One) { IsActive = true };
    var control = new EmptyControl { IsActive = true };
    scene.Add(label);
    scene.Add(control);
    scene.Hide();
    scene.Hide();
    Assert.AreEqual(2, scene.Controls.Count);
    Assert.IsFalse(label.IsVisible);
    Assert.IsFalse(control.IsVisible);
}
[Test, CloseAfterFirstFrame]
public void ControlsDoNotRespondToInputWhenSceneIsHidden()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var button = CreateButton();
    scene.Add(button);
    scene.Hide();
    SetMouseState(State.Pressing, Vector2D.Half);
    Assert.AreEqual(NormalColor, button.Color);
}
See Also