Removed bounding_box.hpp, not needed

This commit is contained in:
2018-08-06 05:54:42 +10:00
parent 13e810df0a
commit d087ff2858
5 changed files with 35 additions and 91 deletions
+18 -9
View File
@@ -69,19 +69,28 @@ std::string TextField::GetText() {
}
bool TextField::MouseButtonDown(SDL_MouseButtonEvent const& event) {
BoundingBox cursorBox = {event.x, event.y, 0, 0};
BoundingBox fieldBox = bounds;
fieldBox.x += posX;
fieldBox.y += posY;
return focus = fieldBox.CheckOverlap(cursorBox);
focus =
event.x > posX &&
event.y > posY &&
event.x < posX + width &&
event.y < posY + height;
return focus;
}
BoundingBox TextField::SetBounds(BoundingBox b) {
return bounds = b;
int TextField::SetWidth(int w) {
return width = w;
}
BoundingBox TextField::GetBounds() {
return bounds;
int TextField::SetHeight(int h) {
return height = h;
}
int TextField::GetWidth() {
return width;
}
int TextField::GetHeight() {
return height;
}
bool TextField::SetFocus(bool b) {