Basic Ritual crafting UI is prototyped, so next step is to create some items and refine the UI with a possible FSM to keep it organized.
This commit is contained in:
parent
1aa6674e42
commit
8b3573b01d
4 changed files with 72 additions and 6 deletions
|
@ -84,6 +84,17 @@ namespace animation {
|
|||
return anim.playing;
|
||||
}
|
||||
|
||||
void rotate(sf::Sprite& target, float degrees) {
|
||||
target.rotate(sf::degrees(degrees));
|
||||
}
|
||||
|
||||
void center(sf::Sprite& target, sf::Vector2f pos) {
|
||||
auto bounds = target.getLocalBounds();
|
||||
target.setPosition({pos.x + bounds.size.x / 2,
|
||||
pos.y + bounds.size.y / 2});
|
||||
target.setOrigin({bounds.size.x / 2, bounds.size.y / 2});
|
||||
}
|
||||
|
||||
void init() {
|
||||
if(!initialized) {
|
||||
Config config("assets/animations.json");
|
||||
|
@ -98,6 +109,7 @@ namespace animation {
|
|||
}
|
||||
|
||||
Animation load(std::string name) {
|
||||
dbc::check(initialized, "You forgot to initialize animation.");
|
||||
return MGR.animations.at(name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue