Bubba-3D  0.9.0
Awesome game engine!
TextLayout.h
1 /*
2  * This file is part of Bubba-3D.
3  *
4  * Bubba-3D is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Bubba-3D is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with Bubba-3D. If not, see http://www.gnu.org/licenses/.
16  */
17 #pragma once
18 
19 #include <Layout.h>
20 #include <Font.h>
21 
25 class TextLayout : public Layout{
26 
27 public:
28 
32  TextLayout(std::string text, Font* font, Dimension width, Dimension height);
33 
34 
35  ~TextLayout() = default;
36 
41  virtual Dimension getWidth();
42 
47  virtual Dimension getHeight();
48 
52  virtual void getGLSquares(float layoutXPos,float layoutYPos, float layoutWidth,
53  float layoutHeight, std::map<std::string, IHudDrawable*> *map);
54 
62  void setText(std::string text);
63 
68  TextLayout* setTextId(std::string id);
69 
70  TextLayout* setPadding(int pixels);
71  TextLayout* setPadding(int topAndBottom, int rightAndLeft);
72  TextLayout* setPadding(int top, int right, int bot, int left);
73 
74 private:
75  std::string text;
76  Font* font;
77  Dimension width;
78  Dimension height;
79  std::string textId = "";
80  int padding[4] = {0,0,0,0};
81 
82 };
Definition: Font.h:27
virtual void getGLSquares(float layoutXPos, float layoutYPos, float layoutWidth, float layoutHeight, std::map< std::string, IHudDrawable * > *map)
Definition: TextLayout.cpp:63
TextLayout * setTextId(std::string id)
Definition: TextLayout.cpp:40
TextLayout(std::string text, Font *font, Dimension width, Dimension height)
Definition: TextLayout.cpp:21
Definition: Layout.h:33
void setText(std::string text)
Definition: TextLayout.cpp:36