refactor: header file for every module
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef ENGINE_GUI_H
|
||||
#define ENGINE_GUI_H
|
||||
|
||||
#include <raylib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "engineSprite.h"
|
||||
|
||||
typedef struct {
|
||||
Sprite sprite;
|
||||
Vector2 notClicked;
|
||||
Vector2 hover;
|
||||
Vector2 clicked;
|
||||
bool isHovered;
|
||||
bool isClicked;
|
||||
} ImageButton;
|
||||
|
||||
typedef struct {
|
||||
Sprite sprite;
|
||||
} ImageElement;
|
||||
|
||||
typedef struct {
|
||||
Rectangle rec;
|
||||
char *text;
|
||||
} Button;
|
||||
|
||||
ImageButton CreateImageButton(Texture2D *texture, const TextureAsset *asset, Vector2 *source,
|
||||
Vector2 *clicked, Vector2 *hover, Rectangle *destRec);
|
||||
ImageButton CreateMenuButton(Texture2D *texture, const TextureAsset *asset, int textureRow,
|
||||
int screenRank, int buttonWidth, int buttonHeight,
|
||||
Vector2 windowCenter, int buttonSpacing);
|
||||
ImageElement CreateImageElement(Texture2D *texture, const TextureAsset *asset, Vector2 *source,
|
||||
Rectangle *destRec);
|
||||
int isImageButtonClicked(ImageButton *b, Sound soundHover, Sound soundClick);
|
||||
void renderImageButton(ImageButton *b);
|
||||
void renderImageElement(ImageElement *e);
|
||||
|
||||
Button initButton(char *text, Vector2 dimensions, Vector2 position);
|
||||
int isButtonClicked(Button *b);
|
||||
void renderButton(Button *b);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user