From e479ec5d45fd8bb936fe7f296371515ee37a1fa2 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 4 May 2018 15:28:57 -0700 Subject: 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. --- src/stage.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/stage.h') 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); -- cgit v1.2.3