-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextObject.h
More file actions
33 lines (30 loc) · 808 Bytes
/
Copy pathTextObject.h
File metadata and controls
33 lines (30 loc) · 808 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
#pragma once
#include <string>
#include <memory>
#include "GameObject.h"
#include "Transform.h"
namespace dae
{
class Font;
class Texture2D;
class TextObject final : public GameObject
{
public:
void Update() override;
void Render() const override;
void SetText(const std::string& text);
void SetPosition(float x, float y);
TextObject(const std::string& text, std::shared_ptr<Font> font);
virtual ~TextObject() = default;
TextObject(const TextObject& other) = delete;
TextObject(TextObject&& other) = delete;
TextObject& operator=(const TextObject& other) = delete;
TextObject& operator=(TextObject&& other) = delete;
private:
bool m_needsUpdate;
std::string m_text;
Transform m_transform{};
std::shared_ptr<Font> m_font;
std::shared_ptr<Texture2D> m_textTexture;
};
}