You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
787 B
36 lines
787 B
#ifndef UI_ELEMENT_UTILS_INCLUDED
|
|
#define UI_ELEMENT_UTILS_INCLUDED
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
typedef enum {
|
|
POSX_LEFT,
|
|
POSX_CENTER,
|
|
POSX_RIGHT
|
|
} PositionX_Type;
|
|
|
|
typedef enum {
|
|
POSY_TOP,
|
|
POSY_CENTER,
|
|
POSY_BOTTOM
|
|
} PositionY_Type;
|
|
|
|
typedef enum {
|
|
ASPECT_KEEP_W,
|
|
ASPECT_KEEP_H,
|
|
ASPECT_IGNORE
|
|
} AspectRatioType;
|
|
|
|
typedef struct {
|
|
SDL_Rect base100;
|
|
PositionX_Type tpX;
|
|
PositionY_Type tpY;
|
|
AspectRatioType aspectType;
|
|
} PositionSpecifier;
|
|
|
|
PositionSpecifier newPositionSpecifier(const SDL_Rect* const base100, const PositionX_Type tpX, const PositionY_Type tpY, const AspectRatioType aspectType);
|
|
|
|
SDL_Rect adaptPosToRect(const PositionSpecifier *const positionSpecifier, const SDL_Rect *const globalRect);
|
|
|
|
#endif //UI_ELEMENT_UTILS_INCLUDED
|