> For the complete documentation index, see [llms.txt](https://asrob-uc3m.gitbook.io/robotdevastation-developer-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asrob-uc3m.gitbook.io/robotdevastation-developer-manual/robotdevastation/managers/user-interface-management/screens.md).

# Screens

## Screen class

The `Screen` class defines the interface required for a Robot Devastation in-game screen. Inheriting from this class allows the creation of different game screens. Currently, all implementations of game screens use SDL as graphics backend.

The main methods of a `Screen` are:

* `init()`: this method should be called before the `Screen` is set as current screen in the `ScreenManager`. It performs the resource loading and initialization.
* `cleanup()`: this method should be called to free all the resources reserved or loaded by the `Screen` before finishing the program.
* `drawScreen()`: performs all the required graphic operations to draw the screen graphical elements. A screen canvas is passed as argument to this method, whose type depends on the graphics backend being used.
* `update()`: updates the `Screen` contents after some displayed parameter has changed. Currently, several signatures are used as they are required by the corresponding `Screen`. An alternative implementation could use void \* or templates to simplify the API, leaving a single `update()` method.

## Mock Screen class

Simple Screen for testing that shows a funny image with a custom message. This message can be configured through the `update()`method.

![](/files/-LCTqDWM4dV5ZkDA2ch9)

## Init Screen class

`Screen` to be shown when the Robot Devastation game is started ([InitState](https://github.com/asrob-uc3m/robotDevastation-developer-manual/tree/851afbda549f0939db0f52e63b52dc56108d7dca/user-interface-management/init-state.md)). It is just a splash screen showing the Robot Devastation logo.

![](/files/-LCTqDXLggnq0Fu-P1ei)

## Game Screen class

This `Screen` is the main game screen. Shows the video stream of the robot's point of view. On top of it, the game HUD, including health, ammo and other players' info is drawn.

![](/files/-LCTqDZ2jG37ucBpk2Kv)

## Dead Screen class

This \`Screen is shown when the player dies. It shows the time the player has to wait until he is respawned.

![](/files/-LCTqD_Qdw4WC1NA2GFU)


---

# 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://asrob-uc3m.gitbook.io/robotdevastation-developer-manual/robotdevastation/managers/user-interface-management/screens.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.
