GodotPageNavigation 2.0.0

dotnet add package GodotPageNavigation --version 2.0.0
                    
NuGet\Install-Package GodotPageNavigation -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GodotPageNavigation" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GodotPageNavigation" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GodotPageNavigation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GodotPageNavigation --version 2.0.0
                    
#r "nuget: GodotPageNavigation, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GodotPageNavigation@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GodotPageNavigation&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GodotPageNavigation&version=2.0.0
                    
Install as a Cake Tool

Godot Page Navigation

Provides a simple stack-based page navigation system for Godot (C#), inspired by mobile app frameworks such as .NET MAUI.

The goal is to make page-style navigation easy:

  • Push a new page onto a stack.
  • Pop back to the previous page.
  • Keep only the current page attached to the root host node.

Repository Structure

  • GodotPageNavigation/
    • Reusable library with the core navigation stack (PageStack) and navigation interfaces.
  • godot-page-navigation-example/
    • Runnable Godot example that demonstrates how to use the library in a project.

Core Concepts

  • PageStack
    • Manages a stack of instantiated pages (Node).
    • Handles page switching by removing the previous page from the host and adding the current page.
    • Supports Push(...), Pop(), and ClearToRoot().
  • INavigationAware
    • Optional interface for pages that want a reference to the active PageStack.
  • INavigationPage
    • Optional interface for lifecycle hooks: OnNavigatedTo() and OnNavigatedFrom().

How to Use

  1. Reference GodotPageNavigation from your Godot C# project.
  2. Create a root host scene/script (for example, a Control) that initializes PageStack.
  3. Push your initial page in _Ready().
  4. In each page, call Navigation.Push(...) and Navigation.Pop() as needed.

Minimal Example

using Godot;
using GodotPageNavigation;

public partial class AppRoot : Control
{
    public PageStack Navigation { get; private set; } = null!;

    public override void _Ready()
    {
        Navigation = new PageStack(this);
        Navigation.Push("res://Scenes/MainPage.tscn");
    }
}
using Godot;
using GodotPageNavigation;

public partial class MainPage : PanelContainer, INavigationAware
{
    public PageStack? Navigation { get; set; }

    private void OnOpenDetailsPressed()
    {
        Navigation?.Push("res://Scenes/DetailsPage.tscn");
    }

    private void OnBackPressed()
    {
        Navigation?.Pop();
    }
}

Running the Example

  1. Open godot-page-navigation-example in Godot 4.5+ with .NET support enabled.
  2. Build or run the project.
  3. Use the buttons to push and pop pages and observe stack depth updates.

Notes

  • Pop() is root-safe: it returns false when there is only one page left on the stack.
  • The included example is intentionally simple and focused on core navigation behavior.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 130 3/7/2026