-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputBox.h
More file actions
47 lines (30 loc) · 901 Bytes
/
InputBox.h
File metadata and controls
47 lines (30 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Created by Kristal Hong on 11/16/23.
//
#ifndef CS8_DROPDOWNMENU_INPUTBOX_H
#define CS8_DROPDOWNMENU_INPUTBOX_H
#include "Item.h"
#include "Fonts.h"
#include "MouseEvents.h"
class InputBox : public sf::Drawable
{
public:
InputBox();
void setSelectedItem(Item* item);
void addEventHandler(sf::RenderWindow &window, sf::Event event);
void draw(sf::RenderTarget& window, sf::RenderStates states) const;
sf::FloatRect getGlobalBounds() const;
void setText(const std::string& text);
std::string getText() const;
void setPosition(sf::Vector2f position);
void setSize(sf::Vector2f position);
Item* getSelectedItem();
sf::Vector2f getPosition() const;
sf::Vector2f getSize() const;
private:
Item* selectedItem;
sf::RectangleShape shape;
bool isClicked = false;
sf::Text buttonText;
};
#endif //CS8_DROPDOWNMENU_INPUTBOX_H