#include "game_object.hpp"
#include "scripting/text.hpp"
#include "script_interface.hpp"
+#include "anchor_point.hpp"
class Font;
public ScriptInterface
{
public:
- TextObject();
+ TextObject(std::string name = "");
virtual ~TextObject();
- void expose(HSQUIRRELVM vm, int table_idx);
- void unexpose(HSQUIRRELVM vm, int table_idx);
+ void expose(HSQUIRRELVM vm, SQInteger table_idx);
+ void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
void set_text(const std::string& text);
void set_font(const std::string& name);
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);
float fadetime;
bool visible;
bool centered;
+ AnchorPoint anchor;
+ Vector pos;
};
#endif
-