Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
textfieldhudgetvoxels.h
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include "hudget.h"
7 #include "ui/voxelfontconstants.h"
8 
9 class TextFieldHudget;
10 class VoxelFont;
11 
13 public:
14  TextFieldHudgetVoxels(TextFieldHudget* textFieldHudget, const glm::vec3& direction, float scale = 0.5f, const std::string& text = "", FontSize fontSize = FontSize::SIZE5x7);
15 
16  void setText(const std::string& text);
17 
18  void update(float deltaSec);
19  void draw();
20 
21  virtual bool isAt(const Ray& ray) const;
22 
23  float width();
24  float height();
25  float scale();
26 
27 
28 protected:
29  FontSize m_fontSize;
30  TextFieldHudget* m_textFieldHudget;
31  std::string m_text;
32  VoxelFont* m_voxelFont;
33  glm::vec3 m_direction;
34  float m_width, m_height, m_scale;
35  float m_offset;
36 
37 
38  const glm::vec3 offsetToCenter(bool upper, bool left) const;
39 
40  const glm::vec3 upperLeft() const;
41  const glm::vec3 lowerLeft() const;
42  const glm::vec3 upperRight() const;
43  const glm::vec3 lowerRight() const;
44 
45  glm::vec3 worldPosition() const;
46  glm::quat worldOrientation() const;
47 };
48 
Definition: textfieldhudgetvoxels.h:12
Definition: textfieldhudget.h:12
Definition: voxelfont.h:15
Definition: ray.h:12