Add spritesheet and change image format

This commit is contained in:
Pk11
2021-08-26 11:12:27 -05:00
parent ad6e5c4d2d
commit a1ac060ce3
8 changed files with 336 additions and 162 deletions
+8 -8
View File
@@ -28,9 +28,9 @@
#define _UNIVERSAL_CORE_GUI_HPP
#include "font.hpp"
#include "image.hpp"
#include "screen.hpp"
#include "sprite.hpp"
#include "spritesheet.hpp"
#include <nds/ndstypes.h>
@@ -66,23 +66,23 @@ namespace Gui {
void clearScreen(bool top);
/*
Load an image (TODO: spritesheets?).
Load an a spritesheet
Path: Path to the image file. (GFX)
sheet: Reference to the Image declaration.
Path: Path to the spritesheet file. (TDX)
sheet: Reference to the Spritesheet declaration.
*/
bool loadSheet(const char *Path, Image &image);
bool loadSheet(const char *Path, Spritesheet &image);
/*
Draw an image.
image: The image which should be used.
imgIndex: For compatibility with 3DS, unused.
image: The spritesheet which should be used.
imgIndex: Index within the spritesheet.
x: The X Position where the sprite should be drawn.
y: The Y Position where the sprite should be drawn.
ScaleX: The X-Scale for the sprite. (Optional!)
ScaleY: The Y-Scale for the sprite. (Optional!)
*/
void DrawSprite(Image image, size_t imgindex, int x, int y, float ScaleX = 1.0f, float ScaleY = 1.0f);
void DrawSprite(Spritesheet &sheet, size_t imgindex, int x, int y, float ScaleX = 1.0f, float ScaleY = 1.0f);
/*
Initialize the GUI.