- [FIX] l'animació no funcionava be
- Versió del Update dels actors per al Editor - [NEW] gui::TextBox - [NEW] input::getKeyPressed() - Acabant el editor...
This commit is contained in:
@@ -25,4 +25,23 @@ namespace ui
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int textbox(const char *label, const int x, const int y, const int w, const int h, const int c1, const int c2)
|
||||
{
|
||||
const int mx = input::mouseX();
|
||||
const int my = input::mouseY();
|
||||
const bool inside = (mx>=x) && (mx<x+w) && (my>=y) && (my<y+h);
|
||||
const int txt_size = strlen(label)*4;
|
||||
const int txt_x = x+(w-txt_size)/2;
|
||||
|
||||
draw::color(inside?c2:c1);
|
||||
draw::fillrect(x, y, w, h);
|
||||
draw::print(label, 1+txt_x, y+3, LIGHT+WHITE, PAPER);
|
||||
|
||||
if (inside)
|
||||
{
|
||||
return input::getKeyPressed();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user