| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // text_engine.hpp
- // engine
- //
- // Created by Sam Jaffe on 5/25/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <memory>
- #include <string>
- #include <unordered_map>
- #include <game/graphics/object.hpp>
- #include <game/math/math_fwd.hpp>
- #include <math/vector/vector.hpp>
- namespace engine {
- class text_engine {
- public:
- struct cell {
- math::vec2 origin;
- math::vec2 size;
- std::string content;
- };
- public:
- text_engine(std::string const & font,
- std::shared_ptr<graphics::manager const> manager);
- void create_text_cells(std::vector<graphics::object> & out, cell const & in);
- private:
- // std::shared_ptr<graphics::manager const> manager_;
- std::string font_;
- graphics::object prototype_;
- std::unordered_map<char, math::vec2> glyphs_;
- };
- }
|