@@ -22,19 +22,16 @@ namespace raylib {
2222 Image (const std::string& fileName) {
2323 Load (fileName);
2424 }
25- Image (::Color* pixels, int width, int height) {
26- LoadEx (pixels, width, height);
27- }
28- Image (void * data, int width, int height, int format) {
29- LoadPro (data, width, height, format);
30- }
3125 Image (const std::string& fileName, int width, int height, int format, int headerSize) {
3226 LoadRaw (fileName, width, height, format, headerSize);
3327 }
28+ Image (const std::string& fileName, int * frames) {
29+ LoadAnim (fileName, frames);
30+ }
3431 Image (::Texture2D texture) {
3532 set (::GetTextureData (texture));
3633 }
37- Image (int width, int height, Color color = raylib::Color::RayWhite ) {
34+ Image (int width, int height, Color color = WHITE ) {
3835 set (::GenImageColor (width, height, color));
3936 }
4037
@@ -108,18 +105,14 @@ namespace raylib {
108105 set (::LoadImage (fileName.c_str ()));
109106 }
110107
111- void LoadEx (::Color* pixels, int width, int height) {
112- set (::LoadImageEx (pixels, width, height));
113- }
114-
115- void LoadPro (void * data, int width, int height, int format) {
116- set (::LoadImagePro (data, width, height, format));
117- }
118-
119108 void LoadRaw (const std::string& fileName, int width, int height, int format, int headerSize) {
120109 set (::LoadImageRaw (fileName.c_str (), width, height, format, headerSize));
121110 }
122111
112+ void LoadAnim (const std::string& fileName, int * frames) {
113+ set (::LoadImageAnim (fileName.c_str (), frames));
114+ }
115+
123116 inline void Unload () {
124117 ::UnloadImage (*this );
125118 };
@@ -238,8 +231,8 @@ namespace raylib {
238231 return *this ;
239232 }
240233
241- inline ::Color* ExtractPalette (int maxPaletteSize, int *extractCount) {
242- return ::ImageExtractPalette (*this , maxPaletteSize, extractCount);
234+ inline ::Color* GetPalette (int maxPaletteSize, int *extractCount) {
235+ return ::GetImagePalette (*this , maxPaletteSize, extractCount);
243236 }
244237
245238 inline Rectangle GetAlphaBorder (float threshold) {
@@ -301,12 +294,16 @@ namespace raylib {
301294 return *this ;
302295 }
303296
304- inline Image& DrawText (::Vector2 position, const std::string& text, int fontSize, ::Color color = WHITE){
305- ::ImageDrawText (this , position, text.c_str(), fontSize, color);
297+ inline Image& DrawText (const std::string& text, ::Vector2 position, int fontSize, ::Color color = WHITE){
298+ ::ImageDrawText (this , text.c_str(), (int )position.x, (int )position.y, fontSize, color);
299+ return *this ;
300+ }
301+ inline Image& DrawText (const std::string& text, int x, int y, int fontSize, ::Color color = WHITE){
302+ ::ImageDrawText (this , text.c_str(), x, y, fontSize, color);
306303 return *this ;
307304 }
308- inline Image& DrawText (::Vector2 position, :: Font font, const std::string& text, float fontSize, float spacing, ::Color color = WHITE){
309- ::ImageDrawTextEx (this , position, font, text.c_str(), fontSize, spacing, color );
305+ inline Image& DrawText (::Font font, const std::string& text, ::Vector2 position, float fontSize, float spacing, ::Color tint = WHITE){
306+ ::ImageDrawTextEx (this , font, text.c_str(), position, fontSize, spacing, tint );
310307 return *this ;
311308 }
312309
0 commit comments