transfered from codeberg
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#include "user_interface.h"
|
||||
|
||||
#include "performance.h"
|
||||
#include "player.h"
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Renders the 2D overlay, including the crosshair, positional coordinates,
|
||||
* and performance metrics.
|
||||
*/
|
||||
void draw_ui_2D(struct player_struct *player)
|
||||
{
|
||||
int screen_center_coordinate_x = GetScreenWidth() / 2;
|
||||
int screen_center_coordinate_y = GetScreenHeight() / 2;
|
||||
|
||||
uint8_t crosshair_line_length = 10;
|
||||
uint8_t crosshair_line_thickness = 2;
|
||||
|
||||
DrawRectangle(
|
||||
screen_center_coordinate_x - crosshair_line_length,
|
||||
screen_center_coordinate_y - (crosshair_line_thickness / 2),
|
||||
crosshair_line_length * 2,
|
||||
crosshair_line_thickness,
|
||||
PINK
|
||||
);
|
||||
|
||||
DrawRectangle(
|
||||
screen_center_coordinate_x - (crosshair_line_thickness / 2),
|
||||
screen_center_coordinate_y - crosshair_line_length,
|
||||
crosshair_line_thickness,
|
||||
crosshair_line_length * 2,
|
||||
PINK
|
||||
);
|
||||
|
||||
draw_coordinates(player->camera.position);
|
||||
draw_fps_counter();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef ui_h
|
||||
#define ui_h
|
||||
|
||||
struct player_struct;
|
||||
|
||||
/**
|
||||
* Renders the 2D overlay, including the crosshair, positional coordinates,
|
||||
* and performance metrics.
|
||||
*/
|
||||
void draw_ui_2D(struct player_struct* player);
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user