diff --git a/demo/Demo.cpp b/demo/Demo.cpp index 82dde40..4d57eee 100644 --- a/demo/Demo.cpp +++ b/demo/Demo.cpp @@ -4,14 +4,14 @@ game, screen + sprite wipes, screen offset, screen scale, networking, post processing, all objects deactivatable, all objects subscribed to events, all objects resetable, wrapable & scrollable surface, separate window for - configuration console, text editor for config json, asset favoriting, audio - filters, enforce consistent angle orientation, floating point coordinates, - relative coordinates, relative lengths, relative sizes, delta time, specify - config parameters on command line, effects chain, asset dict with metadata, - move added sprite locations by offset when location is changed, gradients, - level select code input, logging, variable screen resolution, debug display, - loading wheel animation, shadowed sprite, separate update and draw, sprite - movement cage + configuration console and variable viewer, text editor for config json, asset + favoriting, audio filters, enforce consistent angle orientation, floating + point coordinates, relative coordinates, relative lengths, relative sizes, + delta time, specify config parameters on command line, effects chain, asset + dict with metadata, move added sprite locations by offset when location is + changed, gradients, level select code input, logging, variable screen + resolution, debug display, loading wheel animation, shadowed sprite, separate + update and draw, sprite movement cage :) SWEATY HANDS :) OILY SNACKS :) AND BAD HYGIENE :) diff --git a/src/Sprite.cpp b/src/Sprite.cpp index c331ff1..d1eb94c 100644 --- a/src/Sprite.cpp +++ b/src/Sprite.cpp @@ -280,6 +280,26 @@ glm::vec2 Sprite::get_center(int index) return get_box(index).get_center(); } +void Sprite::set_top(float top) +{ + move({0, top - get_top()}, false); +} + +void Sprite::set_right(float right) +{ + move({right - get_right(), 0}, false); +} + +void Sprite::set_bottom(float bottom) +{ + move({0, bottom - get_bottom()}, false); +} + +void Sprite::set_left(float left) +{ + move({left - get_left(), 0}, false); +} + void Sprite::set_south(const glm::vec2& south) { move(south - get_south(), false); diff --git a/src/Sprite.hpp b/src/Sprite.hpp index c6fcd36..5eeefa5 100644 --- a/src/Sprite.hpp +++ b/src/Sprite.hpp @@ -77,6 +77,10 @@ struct Sprite : Node glm::vec2 get_south(int = 0); glm::vec2 get_west(int = 0); glm::vec2 get_center(int = 0); + void set_top(float); + void set_right(float); + void set_bottom(float); + void set_left(float); void set_nw(const glm::vec2&); void set_ne(const glm::vec2&); void set_south(const glm::vec2&);