mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 07:05:39 +00:00
04841ca436
I really am nuts.
47 lines
932 B
C++
47 lines
932 B
C++
#ifndef _GUIBOX_H_
|
|
#define _GUIBOX_H_
|
|
|
|
#include "../Gui.h"
|
|
#include "GuiImage.h"
|
|
#include <string>
|
|
|
|
struct GuiBoxData
|
|
{
|
|
std::string backgroundPath;
|
|
bool backgroundTiled;
|
|
std::string horizontalPath;
|
|
bool horizontalTiled;
|
|
std::string verticalPath;
|
|
bool verticalTiled;
|
|
std::string cornerPath;
|
|
};
|
|
|
|
class GuiBox
|
|
{
|
|
public:
|
|
GuiBox(int offsetX, int offsetY, unsigned int width, unsigned int height);
|
|
|
|
void setData(GuiBoxData data);
|
|
|
|
void setBackgroundImage(std::string path, bool tiled = true);
|
|
void setHorizontalImage(std::string path, bool tiled = false);
|
|
void setVerticalImage(std::string path, bool tiled = false);
|
|
void setCornerImage(std::string path);
|
|
|
|
bool hasBackground();
|
|
|
|
void render();
|
|
|
|
void onInit();
|
|
void onDeinit();
|
|
private:
|
|
GuiImage mBackgroundImage, mHorizontalImage, mVerticalImage, mCornerImage;
|
|
|
|
int getHorizontalBorderWidth();
|
|
int getVerticalBorderWidth();
|
|
|
|
unsigned int mWidth, mHeight;
|
|
};
|
|
|
|
#endif
|