22 #ifndef GUI_CPP_GUI_TEXT_OVERLAY_H
23 #define GUI_CPP_GUI_TEXT_OVERLAY_H
29 #include <boost/optional.hpp>
37 class Text_overlay :
public Overlay
41 enum Vertical_alignment {valign_top, valign_center, valign_bottom};
42 enum Horizontal_alignment {halign_left, halign_center, halign_right};
45 Text_overlay(
float x,
float y,
float width);
47 void size(
float width)
49 Base::set_size(width, HEIGHT);
52 void background_color(
float x,
float y,
float z,
float a = 1.0)
57 void color(
float x,
float y,
float z,
float a = 1.0)
62 void make_transparent()
64 bg_color_ = boost::none;
67 void set(
const std::string& str)
74 alignment_ = halign_left;
79 alignment_ = halign_right;
84 alignment_ = halign_center;
102 virtual void render()
const;
106 Horizontal_alignment alignment_;
107 Vertical_alignment v_alignment_;
109 boost::optional<kjb::Vector4> bg_color_;
112 static const int CHAR_WIDTH = 8;
113 static const int CHAR_HEIGHT = 13;
114 static const int PADDING = 3;
115 static const int HEIGHT = 2 * PADDING + CHAR_HEIGHT;
126 class Textarea_overlay :
public Overlay
128 typedef Overlay Base;
130 enum Vertical_alignment {valign_top, valign_center, valign_bottom};
131 enum Horizontal_alignment {halign_left, halign_center, halign_right};
134 Textarea_overlay(
float x,
float y,
float width,
float height) :
135 Base(x, y, width, height),
137 alignment_(halign_left),
138 v_alignment_(valign_bottom),
139 color_(0.0,0.0,0.0,1.0),
143 void size(
float width,
float height)
145 Base::set_size(width, height);
148 void background_color(
float x,
float y,
float z,
float a = 1.0)
153 void color(
float x,
float y,
float z,
float a = 1.0)
158 void make_transparent()
160 bg_color_ = boost::none;
163 void set(
const std::string& str)
170 alignment_ = halign_left;
175 alignment_ = halign_right;
180 alignment_ = halign_center;
198 virtual void render()
const;
203 Horizontal_alignment alignment_;
204 Vertical_alignment v_alignment_;
206 boost::optional<kjb::Vector4> bg_color_;
209 static const int CHAR_WIDTH = 8;
210 static const int CHAR_HEIGHT = 13;
211 static const int PADDING = 3;
212 static const int LINE_HEIGHT = 2 * PADDING + CHAR_HEIGHT;
Vector_d< 4 > Vector4
Definition: gr_opengl.h:38
height
Definition: APPgetLargeConnectedEdges.m:33
x
Definition: APPgetLargeConnectedEdges.m:100
void render(const Cuboid &c)
Definition: psi_weighted_box.cpp:56
Definition: g_quaternion.h:37