#pragma once #include #include #include "components.hpp" #include "textures.hpp" #include #include namespace scene { using std::shared_ptr; using namespace textures; struct Element { std::string name; textures::SpriteTexture st; components::Animation anim; std::string cell; float scale_x = 1.0f; float scale_y = 1.0f; float x = 0; float y = 0; bool at_mid=false; sf::Vector2f pos{0,0}; }; struct Engine { guecs::UI $ui; components::AnimatedScene& $scene; std::string $layout; std::unordered_map $actor_name_ids; std::vector $fixtures; std::vector $actors; Engine(components::AnimatedScene& scene); void init(); void render(sf::RenderWindow& window); bool mouse(float x, float y, guecs::Modifiers mods); sf::Vector2f position_sprite(textures::SpriteTexture& st, const std::string& cell_name, float scale_x, float scale_y, bool at_mid, float x_diff=0.0f, float y_diff=0.0f); void move_actor(const std::string& actor, const std::string& cell_name); void animate_actor(const std::string& actor); void play_animations(); }; }