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 | |
21 | namespace scripting { |
22 | |
23 | void |
24 | Text::set_text(const std::string& text) |
25 | { |
26 | SCRIPT_GUARD_VOID; |
27 | object.set_text(text); |
28 | } |
29 | |
30 | void |
31 | Text::set_font(const std::string& fontname) |
32 | { |
33 | SCRIPT_GUARD_VOID; |
34 | object.set_font(fontname); |
35 | } |
36 | |
37 | void |
38 | Text::fade_in(float fadetime) |
39 | { |
40 | SCRIPT_GUARD_VOID; |
41 | object.fade_in(fadetime); |
42 | } |
43 | |
44 | void |
45 | Text::fade_out(float fadetime) |
46 | { |
47 | SCRIPT_GUARD_VOID; |
48 | object.fade_out(fadetime); |
49 | } |
50 | |
51 | void |
52 | Text::set_visible(bool visible) |
53 | { |
54 | SCRIPT_GUARD_VOID; |
55 | object.set_visible(visible); |
56 | } |
57 | |
58 | void |
59 | Text::set_centered(bool centered) |
60 | { |
61 | SCRIPT_GUARD_VOID; |
62 | object.set_centered(centered); |
63 | } |
64 | |
65 | void |
66 | Text::set_pos(float x, float y) |
67 | { |
68 | SCRIPT_GUARD_VOID; |
69 | object.set_pos(Vector(x, y)); |
70 | } |
71 | |
72 | float |
73 | Text::get_pos_x() const |
74 | { |
75 | SCRIPT_GUARD_DEFAULT; |
76 | return object.get_pos().x; |
77 | } |
78 | |
79 | float |
80 | Text::get_pos_y() const |
81 | { |
82 | SCRIPT_GUARD_DEFAULT; |
83 | return object.get_pos().y; |
84 | } |
85 | |
86 | void |
87 | Text::set_anchor_point(int anchor) |
88 | { |
89 | SCRIPT_GUARD_VOID; |
90 | object.set_anchor_point(static_cast<AnchorPoint>(anchor)); |
91 | } |
92 | |
93 | int |
94 | Text::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 |