# Text

## DrawText()

Ritar ut text.

```csharp
// Ritar ut texten "Hello World" på x-position 100 och y-position 50,
// med text i storlek 20 och med orange färg.
Raylib.DrawText("Hello World", 100, 50, 20, Color.ORANGE);
```

## LoadFont()

Laddar in en typsnittsfil (ttf eller otf-format)

```csharp
Font f1 = Raylib.LoadFont(@"Metrophobic.ttf");
```

{% hint style="info" %}
**OBSERVERA:** För att få å, ä och ö att fungera eller för att kunna använda typsnittet i en specifik storlek, använd LoadFontEx istället.
{% endhint %}

## LoadFontEx()

Laddar in en typsnittsfil (ttf eller otf-format) med extra parametrar

```csharp
// Ladda in typsnittsfilen Lato-Regular.ttf, i storleken 36.
//  Vi anger null eftersom vi inte vill ange exakt vilka tecken som ska laddas in.
//  Vi anger 256 eftersom vi vill ladda in de 256 första tecknen – vilket inkluderar åäö
Font f2 = Raylib.LoadFontEx(@"Lato-Regular.ttf", 36, null, 256);
```

## DrawTextEx()

Mer avancerad variant av DrawText, som använder Vector2 för positionering och tillåter att man anger typsnitt. Kräver att man lagt in `using System.Numerics;` högst upp.

```csharp
// Ritar ut texten "Hello" på x- position 20 och y-position 15,
// i storlek 40, utan något extra mellanrum mellan bokstäverna, med svart färg.
Raylib.DrawTextEx(f1, "Hello", new Vector2(20,15), 40,0,Color.BLACK);
```


---

# Agent Instructions: 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:

```
GET https://csharp.progdocs.se/annat/raylib/text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
