Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
menu_layout.c File Reference

Implements the main menu interface. More...

#include <UI_text.h>
#include <app.h>
#include <stdbool.h>
#include <input.h>
#include <sound.h>
#include <controls.h>
#include <math.h>

Functions

void Menu_PrepareTextures ()
 [Start] Loads textures and creates UI elements for the menu
 
void Menu_Update ()
 [PostUpdate] Processes user input for menu buttons
 
void Menu_Render ()
 [Render] Draws the main menu to the screen
 

Variables

SDL_Rect startButtonRect = {27, 140, 200, 15}
 
SDL_Rect controlsButtonRect = {27, 160, 200, 15}
 
SDL_Rect exitButtonRect = {27, 180, 200, 15}
 
Vec2 backgroundSize = {0, 0}
 

Detailed Description

Implements the main menu interface.

Handles layout, rendering, and interactions for the main menu screen, including buttons for starting the game, options, and exit.

Author
Mango
Date
2025-03-04

Function Documentation

◆ Menu_PrepareTextures()

void Menu_PrepareTextures ( )

[Start] Loads textures and creates UI elements for the menu

Prepares and loads all menu textures.

Initializes all resources needed for the main menu, including the background, title, and button elements.

◆ Menu_Render()

void Menu_Render ( )

[Render] Draws the main menu to the screen

Renders the menu to the screen.

Renders the background, title, and interactive button elements with appropriate hover effects.

◆ Menu_Update()

void Menu_Update ( )

[PostUpdate] Processes user input for menu buttons

Updates the menu state based on user input.

Handles mouse hover and click events for the menu buttons, changing their appearance and triggering appropriate actions.

Variable Documentation

◆ backgroundSize

Vec2 backgroundSize = {0, 0}

◆ controlsButtonRect

SDL_Rect controlsButtonRect = {27, 160, 200, 15}

◆ exitButtonRect

SDL_Rect exitButtonRect = {27, 180, 200, 15}

◆ startButtonRect

SDL_Rect startButtonRect = {27, 140, 200, 15}