> 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> . 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
