Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class Scene

    Inheritance
    object
    Scene
    EditorPreviewScene
    InputSystemDemoScene
    QuakeMapScene
    EngineSplashScreenScene
    RollbackScene
    Scene3D
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: PopcorningGuineaPig.Engine.Scenes
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public abstract class Scene : IDisposable

    Properties

    | Edit this page View Source

    CommandHandler

    Optional command sink for PGPSCN action side effects (scene_transition, play_sound). Runtime wires this to SceneManager/SoundPlayer; the editor's SceneBridge passes a no-op implementation so previewed scenes do not navigate away or play audio. Null falls back to the legacy Instance dispatch in ExecuteCommand(CommandDefinition).

    Declaration
    public ISceneCommandHandler? CommandHandler { get; set; }
    Property Value
    Type Description
    ISceneCommandHandler
    | Edit this page View Source

    DynamicBindings

    Declaration
    protected List<DynamicBinding> DynamicBindings { get; }
    Property Value
    Type Description
    List<DynamicBinding>
    | Edit this page View Source

    HidesOsCursor

    When true, the OS cursor stays hidden for the life of this scene (splash logos, etc.). Game applies it via FrameInput.ForceHideOsCursor each frame.

    Declaration
    public virtual bool HidesOsCursor { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    HierarchyManager

    Declaration
    public UIHierarchyManager? HierarchyManager { get; set; }
    Property Value
    Type Description
    UIHierarchyManager
    | Edit this page View Source

    Host

    Host providing the rendering/asset/input context the scene needs to load. Set by the runtime (Game passes itself before calling Load()) or by an editor host (SceneBridge). When null, Load() falls back to Instance so unmigrated game subclasses keep working unchanged.

    Declaration
    public ISceneHost? Host { get; set; }
    Property Value
    Type Description
    ISceneHost
    | Edit this page View Source

    IsLoaded

    Declaration
    public bool IsLoaded { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    SceneData

    Declaration
    protected SceneData? SceneData { get; }
    Property Value
    Type Description
    SceneData
    | Edit this page View Source

    SceneFileElements

    Declaration
    protected Dictionary<string, object>? SceneFileElements { get; set; }
    Property Value
    Type Description
    Dictionary<string, object>
    | Edit this page View Source

    SceneInputContext

    Declaration
    protected InputContext SceneInputContext { get; }
    Property Value
    Type Description
    InputContext
    | Edit this page View Source

    SceneLoader

    Declaration
    protected SceneLoader? SceneLoader { get; }
    Property Value
    Type Description
    SceneLoader

    Methods

    | Edit this page View Source

    AddBinding(DynamicBinding)

    Declaration
    public void AddBinding(DynamicBinding binding)
    Parameters
    Type Name Description
    DynamicBinding binding
    | Edit this page View Source

    ConfigureInputBindings()

    Declaration
    protected virtual void ConfigureInputBindings()
    | Edit this page View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Edit this page View Source

    GetElementOrNull<T>(string)

    Gets a UI element of the specified type by its ID from the scene file, returning null if not found. This method allows for graceful handling of optional UI elements.

    Declaration
    protected T? GetElementOrNull<T>(string elementId) where T : class
    Parameters
    Type Name Description
    string elementId

    The ID of the element as defined in the .pgpscn file

    Returns
    Type Description
    T

    The UI element cast to the specified type, or null if not found

    Type Parameters
    Name Description
    T

    The type of UI element to retrieve

    | Edit this page View Source

    GetElement<T>(string)

    Gets a UI element of the specified type by its ID from the scene file. This method is used by generated properties to provide strongly-typed access to UI elements.

    Declaration
    protected T GetElement<T>(string elementId) where T : class
    Parameters
    Type Name Description
    string elementId

    The ID of the element as defined in the .pgpscn file

    Returns
    Type Description
    T

    The UI element cast to the specified type

    Type Parameters
    Name Description
    T

    The type of UI element to retrieve

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the element is not found or cannot be cast to the specified type

    | Edit this page View Source

    GetSceneFilePath()

    Resolves the PGPSCN file the scene loads from. Default convention is scenes/{TypeName}.pgpscn, matching the runtime path where game scenes are subclasses pinned by type. Editor preview hosts override this to point at an arbitrary file the user picked — the scene type is generic and the filename is data, not code.

    Declaration
    protected virtual string GetSceneFilePath()
    Returns
    Type Description
    string
    | Edit this page View Source

    Load()

    Declaration
    public virtual void Load()
    | Edit this page View Source

    OnLoad()

    Declaration
    protected virtual void OnLoad()
    | Edit this page View Source

    OnUnload()

    Declaration
    protected virtual void OnUnload()
    | Edit this page View Source

    Render(int, int)

    Declaration
    public virtual void Render(int width, int height)
    Parameters
    Type Name Description
    int width
    int height
    | Edit this page View Source

    ResolveBindingSource(BindingSource, object)

    Declaration
    protected object ResolveBindingSource(BindingSource source, object fallback)
    Parameters
    Type Name Description
    BindingSource source
    object fallback
    Returns
    Type Description
    object
    | Edit this page View Source

    ResolveHost()

    Service-access helper. Prefers an explicitly set Host; falls back to Instance so existing game scenes that never assign a host continue to resolve services the legacy way. Returns null only when neither is available (test scenarios that intentionally exercise the no-host edge case).

    Declaration
    protected ISceneHost? ResolveHost()
    Returns
    Type Description
    ISceneHost
    | Edit this page View Source

    SetSceneData(SceneData)

    Declaration
    public void SetSceneData(SceneData sceneData)
    Parameters
    Type Name Description
    SceneData sceneData
    | Edit this page View Source

    Unload()

    Declaration
    public virtual void Unload()
    | Edit this page View Source

    Update(double)

    Declaration
    public virtual void Update(double deltaTime)
    Parameters
    Type Name Description
    double deltaTime
    | Edit this page View Source

    UpdateBindings()

    Declaration
    protected void UpdateBindings()

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.