32 lines
808 B
C++
32 lines
808 B
C++
#include "button_label_tl.hpp"
|
|
|
|
#include "graphics_primitive.hpp"
|
|
|
|
namespace widget {
|
|
|
|
const static float label_depth = 10.0 / 5.0;
|
|
const static int label_color = 0xffffff;
|
|
|
|
const static float label_shadow_depth = 10.0 / 6.0;
|
|
const static int label_shadow_color = 0x000000;
|
|
|
|
void button_label_tl::draw_label(ta_parameter_writer& writer) const
|
|
{
|
|
float y_offset = (float)(click_state != click_type::release);
|
|
|
|
float cx = x() + width / 2 - (glyph::hori_advance * label_length) / 2;
|
|
float cy = y() + height / 2 - glyph::vert_advance / 2 + y_offset;
|
|
|
|
transfer_string(writer, label, cx, cy, label_depth, label_color);
|
|
}
|
|
|
|
void button_label_tl::draw(ta_multiwriter& multi)
|
|
{
|
|
transfer_global_polygon_glyph(multi.pt);
|
|
|
|
draw_label(multi.pt);
|
|
|
|
button_tl::draw(multi);
|
|
}
|
|
}
|