This guide walks you from a blank .NET project to a running Prowl.Paper UI in four steps. By the end you will have Paper installed, a renderer wired up, a working frame loop, and a clickable button on screen.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Paper/llms.txt
Use this file to discover all available pages before exploring further.
That single package brings in the layout engine, the animation system, the text renderer, and all core APIs. The only transitive dependency is Prowl.Quill, which is pulled in automatically.
A renderer backend is not included in the NuGet package — you must supply one. See Step 2 below, or read the full Installation guide for backend details.
Paper draws everything through the
ICanvasRenderer interface, so it is completely decoupled from any specific graphics API. You must pass a concrete renderer to the Paper constructor:// Constructor signature (Paper.Core.cs)
public Paper(ICanvasRenderer renderer, float width, float height, FontAtlasSettings fontAtlas)
Samples/OpenTK/PaperRenderer.csSamples/RaylibSample/RaylibCanvasRenderer.csSamples/WasmExample/// From Samples/RaylibSample/Program.cs
_renderer = new RaylibCanvasRenderer();
P = new Paper(_renderer, width, height, new Prowl.Quill.FontAtlasSettings());
// From Samples/OpenTK/Program.cs
var nativeWindowSettings = new NativeWindowSettings()
{
ClientSize = new Vector2i(1080, 850),
Title = "Paper OpenTK Example",
Flags = OpenTK.Windowing.Common.ContextFlags.ForwardCompatible
};
using var app = new PaperTKWindow(GameWindowSettings.Default, nativeWindowSettings);
app.Run();
Copy the renderer file that matches your graphics backend from
Samples/ into your own project as a starting point. Each renderer is self-contained and under 500 lines.Paper uses
FontAtlasSettings for atlas configuration and AddFallbackFont to register typefaces. Load a font file before your frame loop starts:// Load a TTF font file from a stream and register it as the fallback font
using var stream = File.OpenRead("path/to/font.ttf");
var fontFile = new FontFile(stream);
P.AddFallbackFont(fontFile);
Paper’s API is structured around three calls per frame:
BeginFrame, your UI declarations, and EndFrame. Wrap these inside whatever loop your host framework provides.// In your main loop:
void RenderUI()
{
// Begin the UI frame
P.BeginFrame(deltaTime);
// Define your UI
using (P.Column("MainContainer")
.BackgroundColor(240, 240, 240)
.Enter())
{
// A header
using (P.Box("Header")
.Height(60)
.BackgroundColor(50, 120, 200)
.Text(Text.Center("My Application", myFont, Color.White))
.Enter()) { }
// Content area
using (P.Row("Content").Enter())
{
// Sidebar
P.Box("Sidebar")
.Width(200)
.BackgroundColor(220, 220, 220);
// Main content
P.Box("MainContent");
}
}
// End the UI frame
P.EndFrame();
}
The layout above produces a full-window column with a 60 px header bar, a 200 px sidebar, and a main content area that stretches to fill the remaining space — all without a single size calculation on your part.
using (...Element().Enter()) is the pattern for entering a container element’s scope. Children declared inside the using block are automatically parented to that container. Leaf elements (those with no children) do not need .Enter().Building a Clickable Button
Interactive elements use the same fluent API as static ones — just chain an event handler:Forwarding Input
Paper does not poll input itself; you must forward events from your host framework each frame before callingBeginFrame:
Program.cs files.
Next Steps
Installation
Detailed setup for all three renderer backends, HiDPI configuration, font loading, and a version compatibility table.
Immediate-Mode Concepts
Learn the principles behind the immediate-mode paradigm and how Prowl.Paper applies them.