summaryrefslogtreecommitdiff
path: root/scene/2d/camera_2d.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/camera_2d.h')
-rw-r--r--scene/2d/camera_2d.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h
index 8975a2584b..79d84f48d0 100644
--- a/scene/2d/camera_2d.h
+++ b/scene/2d/camera_2d.h
@@ -36,6 +36,12 @@
class Camera2D : public Node2D {
OBJ_TYPE( Camera2D, Node2D );
+public:
+
+ enum AnchorMode {
+ ANCHOR_MODE_FIXED_TOP_LEFT,
+ ANCHOR_MODE_DRAG_CENTER
+ };
protected:
Point2 camera_pos;
@@ -49,7 +55,7 @@ protected:
RID canvas;
Vector2 offset;
Vector2 zoom;
- bool centered;
+ AnchorMode anchor_mode;
bool rotating;
bool current;
float smoothing;
@@ -77,8 +83,8 @@ public:
void set_offset(const Vector2& p_offset);
Vector2 get_offset() const;
- void set_centered(bool p_centered);
- bool is_centered() const;
+ void set_anchor_mode(AnchorMode p_anchor_mode);
+ AnchorMode get_anchor_mode() const;
void set_rotating(bool p_rotating);
bool is_rotating() const;
@@ -120,4 +126,6 @@ public:
Camera2D();
};
+VARIANT_ENUM_CAST(Camera2D::AnchorMode);
+
#endif // CAMERA_2D_H