summaryrefslogtreecommitdiff
path: root/src/stage.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-05-04 15:28:57 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-05-04 15:28:57 -0700
commite479ec5d45fd8bb936fe7f296371515ee37a1fa2 (patch)
treef56ef9806a3f1d9ace7c24adbbd357a49f0b4785 /src/stage.h
parentde8c678961226d0a7eb1f1276e8f5e842a33c3af (diff)
stage: introduce stage_node_[sg]et_position()
Leaving the existing node aabb semantics as both sizing and placing the node relative to the stage size and its center, add a simple means of statefully shifting the aabb. When the position is left unset, it's 0,0, and effectively a noop leaving the aabb to exclusively size and place the node. If you treat the aabb as purely sizing the node, treating it as centered at 0,0 then you can exclusively use this position api for placement of the node.
Diffstat (limited to 'src/stage.h')
-rw-r--r--src/stage.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stage.h b/src/stage.h
index 05ee3ec..ff43847 100644
--- a/src/stage.h
+++ b/src/stage.h
@@ -44,6 +44,8 @@ stage_node_t * stage_node_free(stage_t *stage, stage_node_t *node);
void stage_node_set_alpha(const stage_t *stage, stage_node_t *node, float alpha);
void stage_node_set_aabb(const stage_t *stage, stage_node_t *node, const aabb_t *aabb);
void stage_node_get_aabb(const stage_t *stage, stage_node_t *node, aabb_t *res_aabb);
+void stage_node_set_position(const stage_t *stage, stage_node_t *node, float x, float y);
+void stage_node_get_position(const stage_t *stage, stage_node_t *node, float *res_x, float *res_y);
void stage_node_set_active(const stage_t *stage, stage_node_t *node);
void stage_node_set_inactive(const stage_t *stage, stage_node_t *node);
void stage_node_set_locked(const stage_t *stage, stage_node_t *node);
© All Rights Reserved