> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/monogame-kni-fna.md).

# MonoGame/KNI/FNA

## Introduction

Before you begin working with Gum, you need a MonoGame/KNI project. This could be a completely empty MonoGame/KNI project, or it could be an existing game.

## Creating an New Project

To create a new MonoGame project, follow the steps in the MonoGame Getting Started tutorial: <https://docs.monogame.net/articles/tutorials/building_2d_games/02_getting_started/index.html?tabs=windows>

To create a new KNI project, see the KNI project page: <https://github.com/kniEngine/kni>

To create a new FNA project, see the FNA setup guide: <https://fna-xna.github.io/docs/1%3A-Setting-Up-FNA/> . Alternatively if you prefer, you can create a copy of the FNA sample project: [https://github.com/vchelaru/Gum/tree/main/Samples/FnaGum](https://github.com/vchelaru/Gum/tree/main/Samples/FnaGum/README.md) . Note that the FNA team recommends linking your project against FNA source. The sample project linked above requires that you have the FNA.Core cproj linked to compile your project.

Once you have your project set up, you should have a Game class similar to the following block of code:

```csharp
namespace MonoGameGum1;

public class Game1 : Game
{
    private GraphicsDeviceManager _graphics;
    private SpriteBatch _spriteBatch;

    public Game1()
    {
        _graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
        IsMouseVisible = true;
    }

    protected override void Initialize()
    {
        base.Initialize();
    }

    protected override void Update(GameTime gameTime)
    {
        base.Update(gameTime);
    }

    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        base.Draw(gameTime);
    }
}
```

Next, you can begin adding Gum to your project. For more information see the [Adding/Initializing Gum](/gum/code/getting-started/setup/adding-initializing-gum/monogame-kni-fna.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/monogame-kni-fna.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
