diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-24 22:49:47 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-24 22:49:47 +1000 |
commit | 7eb010d4a1c6a90d5040b3ec2e7d189fb387b9b2 (patch) | |
tree | 44445bce5cee5387511ac0045072539f5a928294 /source/game/StarDrawable.hpp | |
parent | aa08eaac993a309d3aebc2cd4321513a1e413254 (diff) |
Pretty much working now
Diffstat (limited to 'source/game/StarDrawable.hpp')
-rw-r--r-- | source/game/StarDrawable.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/game/StarDrawable.hpp b/source/game/StarDrawable.hpp index 0109611..cf1c8c8 100644 --- a/source/game/StarDrawable.hpp +++ b/source/game/StarDrawable.hpp @@ -6,6 +6,7 @@ #include "StarPoly.hpp" #include "StarColor.hpp" #include "StarJson.hpp" +#include "StarAssetPath.hpp" namespace Star { @@ -20,7 +21,7 @@ struct Drawable { }; struct ImagePart { - String image; + AssetPath image; // Transformation of the image in pixel space (0, 0) - (width, height) to // the final drawn space Mat3F transformation; @@ -28,17 +29,17 @@ struct Drawable { // Add directives to this ImagePart, while optionally keeping the // transformed center of the image the same if the directives change the // image size. - void addDirectives(String const& directives, bool keepImageCenterPosition); + ImagePart& addDirectives(Directives const& directives, bool keepImageCenterPosition = false); // Remove directives from this ImagePart, while optionally keeping the // transformed center of the image the same if the directives change the // image size. - void removeDirectives(bool keepImageCenterPosition); + ImagePart& removeDirectives(bool keepImageCenterPosition = false); }; static Drawable makeLine(Line2F const& line, float lineWidth, Color const& color, Vec2F const& position = Vec2F()); static Drawable makePoly(PolyF poly, Color const& color, Vec2F const& position = Vec2F()); - static Drawable makeImage(String image, float pixelSize, bool centered, Vec2F const& position, Color const& color = Color::White); + static Drawable makeImage(AssetPath image, float pixelSize, bool centered, Vec2F const& position, Color const& color = Color::White); template <typename DrawablesContainer> static void translateAll(DrawablesContainer& drawables, Vec2F const& translation); |