X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Ftext_object.hpp;h=b5e0862eca7e8ae1195d6fde89f66bbb86b2b808;hb=ca967dcf4ee89f99880355be00782d1cd047be6a;hp=20581add67aa6c308c63d8b04cccc1eff70a5a0a;hpb=8a627e73d824b5a14249cfe066dc2fdc643ce28d;p=supertux.git diff --git a/src/object/text_object.hpp b/src/object/text_object.hpp index 20581add6..b5e0862ec 100644 --- a/src/object/text_object.hpp +++ b/src/object/text_object.hpp @@ -23,6 +23,7 @@ #include "game_object.hpp" #include "scripting/text.hpp" #include "script_interface.hpp" +#include "anchor_point.hpp" class Font; @@ -45,6 +46,36 @@ public: void set_centered(bool centered); bool is_visible(); + void set_anchor_point(AnchorPoint anchor) { + this->anchor = anchor; + } + AnchorPoint get_anchor_point() const { + return anchor; + } + + void set_pos(const Vector& pos) { + this->pos = pos; + } + void set_pos(float x, float y) { + set_pos(Vector(x, y)); + } + const Vector& get_pos() const { + return pos; + } + float get_pos_x() { + return pos.x; + } + float get_pos_y() { + return pos.y; + } + + void set_anchor_point(int anchor) { + set_anchor_point((AnchorPoint) anchor); + } + int get_anchor_point() { + return (int) get_anchor_point(); + } + void draw(DrawingContext& context); void update(float elapsed_time); @@ -55,6 +86,8 @@ private: float fadetime; bool visible; bool centered; + AnchorPoint anchor; + Vector pos; }; #endif