Update renderd7.hpp

This commit is contained in:
tobid7 2021-07-25 11:05:06 +02:00 committed by GitHub
parent ad169b01cb
commit e304bdf00f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,12 +59,19 @@ namespace RenderD7
// The Spritesheet // The Spritesheet
C2D_SpriteSheet spritesheet; C2D_SpriteSheet spritesheet;
}; };
/// Image Class
class Image class Image
{ {
public: public:
/// Load Image from Png
/// path: path to png file
void LoadPng(const std::string path); void LoadPng(const std::string path);
/// Load the Image from buffer
/// buffer: the frame buffer
void LoadPFromBuffer(const std::vector<u8> &buffer); void LoadPFromBuffer(const std::vector<u8> &buffer);
/// Draw the Image directly
/// x: The x position
/// y: the y position
bool Draw(float x, float y, float scaleX = 1.0f, float scaleY = 1.0f); bool Draw(float x, float y, float scaleX = 1.0f, float scaleY = 1.0f);
C2D_Image Get(){return this->img;} C2D_Image Get(){return this->img;}
C2D_Image img; C2D_Image img;