Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
- name: Run Build
run: dotnet docfx ci.docfx.json

- name: Generate PDF
run: dotnet docfx pdf ci.docfx.json

- name: Copy PDF to downloads and clean up
run: |
mkdir -p _site/downloads
cp _site/pdf/MonoGameGuide.pdf _site/downloads/
rm -rf _site/pdf

- name: Setup Pages
uses: actions/configure-pages@v5

Expand Down
30 changes: 26 additions & 4 deletions api/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
---
title: Reference
title: API Reference
description: MonoGame API reference documentation.
---

Welcome to the **MonoGame** reference documentation!
Welcome to the **MonoGame** API reference documentation!

This area provides detailed information on each class and method in the API.
This section provides detailed information on all classes, methods, properties, and events available in the MonoGame framework.

Please view the [documentation](../articles/index.md) for how to get started and step-by-step guidance.
## Namespaces Overview

The MonoGame API is organized into the following primary namespaces:

| Namespace | Description |
| --------- | ----------- |
| **Microsoft.Xna.Framework** | Core framework classes including `Game`, `GameTime`, `Vector2`, `Matrix`, and fundamental types |
| **Microsoft.Xna.Framework.Audio** | Audio playback, sound effects, and music management |
| **Microsoft.Xna.Framework.Content** | Content loading and management with the `ContentManager` |
| **Microsoft.Xna.Framework.Graphics** | Rendering, textures, shaders, and all graphics-related functionality |
| **Microsoft.Xna.Framework.Input** | Keyboard, mouse, gamepad, and touch input handling |
| **Microsoft.Xna.Framework.Media** | Media playback for songs and videos |

## Getting Started

If you're new to MonoGame, we recommend starting with the [documentation](../articles/index.md) for step-by-step tutorials and guidance before diving into the API reference.

## Common Entry Points

- **[Game](xref:Microsoft.Xna.Framework.Game)** - The main game class you inherit from
- **[SpriteBatch](xref:Microsoft.Xna.Framework.Graphics.SpriteBatch)** - 2D rendering and sprite drawing
- **[ContentManager](xref:Microsoft.Xna.Framework.Content.ContentManager)** - Loading game assets
- **[GraphicsDeviceManager](xref:Microsoft.Xna.Framework.GraphicsDeviceManager)** - Graphics configuration
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The managed code objects created by the Content Processor are serialized into a

The format of data in the .XNB file is tightly coupled to the MonoGame Framework. It is not designed for use by other runtime libraries.

If you are intested in the format of the .XNB files you can view the [XNB specification](XNB Format.docx).
If you are intested in the format of the .XNB files you can view the [XNB specification](XNB%20Format.docx).

### Runtime Components

Expand Down
3 changes: 3 additions & 0 deletions articles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ This documentation [helps you to get started](getting_started/index.md) by provi

Please use the links at the top and left to navigate the documentation sections.

> [!TIP]
> Looking for an offline version? [Download the PDF documentation](/downloads/MonoGameGuide.pdf).
>
> This documentation assumes that the reader has a basic knowledge of the C# programming language.

## What is MonoGame exactly?
Expand Down
10 changes: 10 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ if (-not (Test-Path $FrameworkDll) -or -not (Test-Path $PipelineDll)) {
Write-Host "Building DocFx..." -ForegroundColor Green
dotnet docfx docfx.json

# Generate PDF
Write-Host "Generating PDF..." -ForegroundColor Green
dotnet docfx pdf docfx.json

# Copy PDF to downloads folder and clean up
Write-Host "Copying PDF to downloads folder..." -ForegroundColor Green
New-Item -ItemType Directory -Force -Path "_site/downloads" | Out-Null
Copy-Item "_site/pdf/MonoGameGuide.pdf" "_site/downloads/"
Remove-Item -Path "_site/pdf" -Recurse -Force

Write-Host "Build and documentation generation completed successfully!" -ForegroundColor Green
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ fi
echo "Building DocFx..."
dotnet docfx docfx.json

# Generate PDF
echo "Generating PDF..."
dotnet docfx pdf docfx.json

# Copy PDF to downloads folder and clean up
echo "Copying PDF to downloads folder..."
mkdir -p _site/downloads
cp _site/pdf/MonoGameGuide.pdf _site/downloads/
rm -rf _site/pdf

echo "Build and documentation generation completed successfully!"
5 changes: 4 additions & 1 deletion ci.docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"roadmap/**/*.md",
"roadmap/**/*.yml",
"errors/**/*.md",
"pdf/**/*.md",
"pdf/**/*.yml",
"toc.yml",
"*.md"
],
Expand Down Expand Up @@ -69,7 +71,8 @@
"_openGraphImage": "images/social_embed_image.png",
"_description": "One framework for creating powerful cross-platform games.",
"_appTitle": "MonoGame",
"_enableSearch": true
"_enableSearch": true,
"pdfFooterTemplate": "<div style='width: 100%; font-size: 10px; border-top: 1px solid #ccc; padding-top: 5px;'><div style='float: left;'>MonoGame Documentation</div><div style='float: right;'><span class='pageNumber'></span> / <span class='totalPages'></span></div></div>"
},
"template": [
"default",
Expand Down
6 changes: 5 additions & 1 deletion docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}
],
"dest": "api",
"filter": "filterConfig.yml",
"includePrivateMembers": false,
"disableGitFeatures": false,
"disableDefaultFilter": false,
Expand Down Expand Up @@ -41,6 +42,8 @@
"roadmap/**/*.md",
"roadmap/**/*.yml",
"errors/**/*.md",
"pdf/**/*.md",
"pdf/**/*.yml",
"toc.yml",
"*.md"
],
Expand Down Expand Up @@ -69,7 +72,8 @@
"_openGraphImage": "images/social_embed_image.png",
"_description": "One framework for creating powerful cross-platform games.",
"_appTitle": "MonoGame",
"_enableSearch": true
"_enableSearch": true,
"pdfFooterTemplate": "<div style='width: 100%; font-size: 11px; font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif; border-top: 2px solid #e73c00; padding: 8px 20px 0 20px; display: flex; justify-content: space-between; align-items: center;'><span style='color: #e73c00; font-weight: 600;'>MonoGame Complete Reference Guide</span><span style='color: #666;'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></span></div>"
},
"template": [
"default",
Expand Down
4 changes: 4 additions & 0 deletions filterConfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiRules:
- exclude:
uidRegex: ^CppNet
type: Namespace
163 changes: 163 additions & 0 deletions pdf/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
items:
- name: Introduction
href: ../index.md
- name: Getting Started
href: ../../articles/getting_started/index.md
items:
- name: Setting up MacOS
href: ../../articles/getting_started/1_setting_up_your_os_for_development_macos.md
- name: Setting up Linux
items:
- name: Setting up Arch Linux
href: ../../articles/getting_started/1_setting_up_your_os_for_development_arch.md
- name: Setting up Ubuntu
href: ../../articles/getting_started/1_setting_up_your_os_for_development_ubuntu.md
- name: Setting up Windows
href: ../../articles/getting_started/1_setting_up_your_os_for_development_windows.md
- name: Using Visual Studio
href: ../../articles/getting_started/2_choosing_your_ide_visual_studio.md
- name: Using Rider
href: ../../articles/getting_started/2_choosing_your_ide_rider.md
- name: Using Visual Studio Code
href: ../../articles/getting_started/2_choosing_your_ide_vscode.md
- name: Getting to know MonoGame
href: ../../articles/getting_to_know/index.md
items:
- name: What is
href: ../../articles/getting_to_know/whatis/index.md
items:
- name: Audio
href: ../../articles/getting_to_know/whatis/audio/index.md
- name: Content Pipeline
href: ../../articles/getting_to_know/whatis/content_pipeline/index.md
- name: Graphics
href: ../../articles/getting_to_know/whatis/graphics/index.md
- name: Input
href: ../../articles/getting_to_know/whatis/input/index.md
- name: The Game Loop
href: ../../articles/getting_to_know/whatis/game_loop/index.md
- name: Vector / Matrix / Quaternions
href: ../../articles/getting_to_know/whatis/vector_matrix_quat/index.md
- name: MonoGame Class Library
href: ../../articles/getting_to_know/whatis/monogame_class_library/index.md
- name: How to
href: ../../articles/getting_to_know/howto/index.md
items:
- name: Audio
href: ../../articles/getting_to_know/howto/audio/index.md
- name: Content Pipeline
href: ../../articles/getting_to_know/howto/content_pipeline/index.md
- name: Graphics
href: ../../articles/getting_to_know/howto/graphics/index.md
- name: Input
href: ../../articles/getting_to_know/howto/input/index.md
- name: Advanced Topics
items:
- name: Packaging
href: ../../articles/getting_started/packaging_games.md
- name: Preparing for consoles
href: ../../articles/getting_started/preparing_for_consoles.md
- name: Using Development Nuget Packages
href: ../../articles/getting_started/using_development_nuget_packages.md
- name: Tools
items:
- name: Introduction
href: ../../articles/getting_started/tools/index.md
- name: MGCB
href: ../../articles/getting_started/tools/mgcb.md
- name: MGCB Editor
href: ../../articles/getting_started/tools/mgcb_editor.md
- name: MGFXC
href: ../../articles/getting_started/tools/mgfxc.md
- name: Content Pipeline
items:
- name: Introduction
href: ../../articles/getting_started/content_pipeline/index.md
- name: Why use the Content Pipeline
href: ../../articles/getting_started/content_pipeline/why_content_pipeline.md
- name: Using the Content Builder Project
href: ../../articles/getting_started/content_pipeline/content_builder_project.md
- name: Automating the Content Builder
href: ../../articles/getting_started/content_pipeline/automating_content_builder.md
- name: Using MGCB Editor
href: ../../articles/getting_started/content_pipeline/using_mgcb_editor.md
- name: Custom Effects
href: ../../articles/getting_started/content_pipeline/custom_effects.md
- name: TrueType fonts
href: ../../articles/getting_started/content_pipeline/adding_ttf_fonts.md
- name: Localization
href: ../../articles/getting_started/content_pipeline/localization.md
- name: Migration
items:
- name: Migrating from XNA
href: ../../articles/migration/migrate_xna.md
- name: Migrating from 3.7
href: ../../articles/migration/migrate_37.md
- name: Upgrading 3.8.x to latest
href: ../../articles/migration/migrate_38.md
- name: Updating Versions
href: ../../articles/migration/updating_versions.md
- name: Tutorials
href: ../../articles/tutorials/index.md
items:
- name: Building 2D Games
href: ../../articles/tutorials/building_2d_games/index.md
items:
- name: "01: What Is MonoGame?"
href: ../../articles/tutorials/building_2d_games/01_what_is_monogame/index.md
- name: "02: Getting Started"
href: ../../articles/tutorials/building_2d_games/02_getting_started/index.md
- name: "03: The Game1 File"
href: ../../articles/tutorials/building_2d_games/03_the_game1_file/index.md
- name: "04: Creating a Class Library"
href: ../../articles/tutorials/building_2d_games/04_creating_a_class_library/index.md
- name: "05: Content Pipeline"
href: ../../articles/tutorials/building_2d_games/05_content_pipeline/index.md
- name: "06: Working with Textures"
href: ../../articles/tutorials/building_2d_games/06_working_with_textures/index.md
- name: "07: Optimizing Texture Rendering"
href: ../../articles/tutorials/building_2d_games/07_optimizing_texture_rendering/index.md
- name: "08: The Sprite Class"
href: ../../articles/tutorials/building_2d_games/08_the_sprite_class/index.md
- name: "09: The AnimatedSprite Class"
href: ../../articles/tutorials/building_2d_games/09_the_animatedsprite_class/index.md
- name: "10: Handling Input"
href: ../../articles/tutorials/building_2d_games/10_handling_input/index.md
- name: "11: Input Management"
href: ../../articles/tutorials/building_2d_games/11_input_management/index.md
- name: "12: Collision Detection"
href: ../../articles/tutorials/building_2d_games/12_collision_detection/index.md
- name: "13: Working With Tilemaps"
href: ../../articles/tutorials/building_2d_games/13_working_with_tilemaps/index.md
- name: "14: Sound Effects and Music"
href: ../../articles/tutorials/building_2d_games/14_soundeffects_and_music/index.md
- name: "15: Audio Controller"
href: ../../articles/tutorials/building_2d_games/15_audio_controller/index.md
- name: "16: Working with SpriteFonts"
href: ../../articles/tutorials/building_2d_games/16_working_with_spritefonts/index.md
- name: "17: Scenes"
href: ../../articles/tutorials/building_2d_games/17_scenes/index.md
- name: "18: Texture Sampling"
href: ../../articles/tutorials/building_2d_games/18_texture_sampling/index.md
- name: "19: User Interface Fundamentals"
href: ../../articles/tutorials/building_2d_games/19_user_interface_fundamentals/index.md
- name: "20: Implementing UI with Gum"
href: ../../articles/tutorials/building_2d_games/20_implementing_ui_with_gum/index.md
- name: "21: Customizing Gum UI"
href: ../../articles/tutorials/building_2d_games/21_customizing_gum_ui/index.md
- name: "22: Snake Game Mechanics"
href: ../../articles/tutorials/building_2d_games/22_snake_game_mechanics/index.md
- name: "23: Completing the Game"
href: ../../articles/tutorials/building_2d_games/23_completing_the_game/index.md
- name: "24: Shaders"
href: ../../articles/tutorials/building_2d_games/24_shaders/index.md
- name: "25: Packaging Your Game for Distribution"
href: ../../articles/tutorials/building_2d_games/25_packaging_game/index.md
- name: "26: Publishing Your Game to itch.io"
href: ../../articles/tutorials/building_2d_games/26_publish_to_itch/index.md
- name: "27: Conclusion and Next Steps"
href: ../../articles/tutorials/building_2d_games/27_conclusion/index.md
- name: Console Access
href: ../../articles/console_access.md
- name: Help and Support
href: ../../articles/help_and_support.md
68 changes: 68 additions & 0 deletions pdf/cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
_disableContribution: true
_disableBreadcrumb: true
_disableAffix: true
_disableToc: true
_disableNavbar: true
_disableFooter: true
---

<style>
@page { margin: 0 }
html, body {
margin: 0;
padding: 0;
height: 100%;
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
}
.cover-page {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
background-image: url('images/cover.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
color: white;
text-align: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.logo {
width: 500px;
height: auto;
margin-bottom: 40px;
}
.title {
font-size: 48px;
font-weight: bold;
margin-bottom: 20px;
color: #e94560;
}
.subtitle {
font-size: 24px;
margin-bottom: 40px;
color: #a0a0a0;
}
.description {
font-size: 18px;
max-width: 600px;
line-height: 1.6;
color: #cccccc;
}
.footer {
position: absolute;
bottom: 60px;
font-size: 14px;
color: #888888;
}
</style>

<div class="cover-page">
<div class="subtitle">Complete Reference Guide</div>
<div class="footer">
Copyright © 2009-2026 MonoGame Foundation, Inc.
</div>
</div>
Binary file added pdf/images/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading