- [NEW] Dialeg per a configurar els joysticks
This commit is contained in:
24
ui.cpp
24
ui.cpp
@@ -59,6 +59,26 @@ namespace ui
|
||||
offset_y += y;
|
||||
}
|
||||
|
||||
uint8_t getOffsetX()
|
||||
{
|
||||
return offset_x;
|
||||
}
|
||||
|
||||
uint8_t getOffsetY()
|
||||
{
|
||||
return offset_y;
|
||||
}
|
||||
|
||||
bool mouseInside(int x, int y, int w, int h)
|
||||
{
|
||||
int mx, my;
|
||||
Uint32 mb = SDL_GetMouseState(&mx, &my);
|
||||
mx=mx/CHR_W; my=my/CHR_H;
|
||||
mx -= offset_x;
|
||||
my -= offset_y;
|
||||
return (mx >= x) && (mx < x+w) && (my >= y) && (my < y+h);
|
||||
}
|
||||
|
||||
void panel(int x, int y, int w, int h, const char *title)
|
||||
{
|
||||
ui::setoffset(x, y);
|
||||
@@ -133,9 +153,9 @@ namespace ui
|
||||
return clicked;
|
||||
}
|
||||
|
||||
void setDialog(void(*dialog)(void))
|
||||
void setDialog(void(*new_dialog)(void))
|
||||
{
|
||||
ui:dialog = dialog;
|
||||
ui:dialog = new_dialog;
|
||||
}
|
||||
|
||||
bool hasDialog()
|
||||
|
||||
Reference in New Issue
Block a user