1// SuperTux
2// Copyright (C) 2015 Ingo Ruhnke <grumbel@gmail.com>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU 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// This program 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 General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17#include "scripting/text.hpp"
18
19#include "object/text_object.hpp"
20
21namespace scripting {
22
23void
24Text::set_text(const std::string& text)
25{
26 SCRIPT_GUARD_VOID;
27 object.set_text(text);
28}
29
30void
31Text::set_font(const std::string& fontname)
32{
33 SCRIPT_GUARD_VOID;
34 object.set_font(fontname);
35}
36
37void
38Text::fade_in(float fadetime)
39{
40 SCRIPT_GUARD_VOID;
41 object.fade_in(fadetime);
42}
43
44void
45Text::fade_out(float fadetime)
46{
47 SCRIPT_GUARD_VOID;
48 object.fade_out(fadetime);
49}
50
51void
52Text::set_visible(bool visible)
53{
54 SCRIPT_GUARD_VOID;
55 object.set_visible(visible);
56}
57
58void
59Text::set_centered(bool centered)
60{
61 SCRIPT_GUARD_VOID;
62 object.set_centered(centered);
63}
64
65void
66Text::set_pos(float x, float y)
67{
68 SCRIPT_GUARD_VOID;
69 object.set_pos(Vector(x, y));
70}
71
72float
73Text::get_pos_x() const
74{
75 SCRIPT_GUARD_DEFAULT;
76 return object.get_pos().x;
77}
78
79float
80Text::get_pos_y() const
81{
82 SCRIPT_GUARD_DEFAULT;
83 return object.get_pos().y;
84}
85
86void
87Text::set_anchor_point(int anchor)
88{
89 SCRIPT_GUARD_VOID;
90 object.set_anchor_point(static_cast<AnchorPoint>(anchor));
91}
92
93int
94Text::get_anchor_point() const
95{
96 SCRIPT_GUARD_DEFAULT;
97 return static_cast<int>(object.get_anchor_point());
98}
99
100} // namespace scripting
101
102/* EOF */
103