diff --git a/examples/Makefile b/examples/Makefile index 636f5ec62..8517a91c2 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -413,7 +413,6 @@ SHAPES = \ TEXTURES = \ textures/textures_logo_raylib \ textures/textures_mouse_painting \ - textures/textures_rectangle \ textures/textures_srcrec_dstrec \ textures/textures_image_drawing \ textures/textures_image_generation \ @@ -425,12 +424,14 @@ TEXTURES = \ textures/textures_particles_blending \ textures/textures_npatch_drawing \ textures/textures_background_scrolling \ + textures/textures_sprite_anim \ textures/textures_sprite_button \ textures/textures_sprite_explosion \ textures/textures_bunnymark \ textures/textures_blend_modes \ textures/textures_draw_tiled \ - textures/textures_polygon + textures/textures_polygon \ + textures/textures_gif_anim TEXT = \ text/text_raylib_fonts \ diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 9d27443d9..9765a2ffb 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -427,7 +427,6 @@ SHAPES = \ TEXTURES = \ textures/textures_logo_raylib \ textures/textures_mouse_painting \ - textures/textures_rectangle \ textures/textures_srcrec_dstrec \ textures/textures_image_drawing \ textures/textures_image_generation \ @@ -439,6 +438,7 @@ TEXTURES = \ textures/textures_particles_blending \ textures/textures_npatch_drawing \ textures/textures_background_scrolling \ + textures/textures_sprite_anim \ textures/textures_sprite_button \ textures/textures_sprite_explosion \ textures/textures_bunnymark \ @@ -659,7 +659,7 @@ textures/textures_logo_raylib: textures/textures_logo_raylib.c textures/textures_mouse_painting: textures/textures_mouse_painting.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -textures/textures_rectangle: textures/textures_rectangle.c +textures/textures_sprite_anim: textures/textures_sprite_anim.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/scarfy.png@resources/scarfy.png diff --git a/examples/README.md b/examples/README.md index 15ccfc256..6fb655145 100644 --- a/examples/README.md +++ b/examples/README.md @@ -77,7 +77,6 @@ Examples using raylib textures functionality, including image/textures loading/g | ## | example | image | developer | new | |----|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|:------------------------------------------------:|:---:| | 40 | [textures_logo_raylib](textures/textures_logo_raylib.c) | textures_logo_raylib | ray | | -| 41 | [textures_rectangle](textures/textures_rectangle.c) | textures_rectangle | ray | | | 42 | [textures_srcrec_dstrec](textures/textures_srcrec_dstrec.c) | textures_srcrec_dstrec | ray | | | 43 | [textures_image_drawing](textures/textures_image_drawing.c) | textures_image_drawing | ray | | | 44 | [textures_image_generation](textures/textures_image_generation.c) | textures_image_generation | ray | | @@ -89,6 +88,7 @@ Examples using raylib textures functionality, including image/textures loading/g | 50 | [textures_particles_blending](textures/textures_particles_blending.c) | textures_particles_blending | ray | | | 51 | [textures_npatch_drawing](textures/textures_npatch_drawing.c) | textures_npatch_drawing | [Jorge A. Gomes](https://github.com/overdev) | | | 52 | [textures_background_scrolling](textures/textures_background_scrolling.c) | textures_background_scrolling | ray | | +| 41 | [textures_sprite_anim](textures/textures_sprite_anim.c) | textures_sprite_anim | ray | | | 53 | [textures_sprite_button](textures/textures_sprite_button.c) | textures_sprite_button | ray | | | 54 | [textures_sprite_explosion](textures/textures_sprite_explosion.c) | textures_sprite_explosion | ray | | | 55 | [textures_bunnymark](textures/textures_bunnymark.c) | textures_bunnymark | ray | | @@ -96,6 +96,8 @@ Examples using raylib textures functionality, including image/textures loading/g | 57 | [textures_blend_modes](textures/textures_blend_modes.c) | textures_blend_modes | [Karlo Licudine](https://github.com/accidentalrebel) | | | 58 | [textures_draw_tiled](textures/textures_draw_tiled.c) | textures_draw_tiled | [Vlad Adrian](https://github.com/demizdor) | | | -- | [textures_poly](textures/textures_poly.c) | textures_poly | [Chris Camacho](https://github.com/codifies) | ⭐️ | +| -- | [textures_gif_anim](textures/textures_gif_anim.c) | textures_gif_anim | [Chris Camacho](https://github.com/codifies) | ⭐️ | + ### category: text diff --git a/examples/textures/textures_rectangle.c b/examples/textures/textures_sprite_anim.c similarity index 97% rename from examples/textures/textures_rectangle.c rename to examples/textures/textures_sprite_anim.c index eb9f818b5..0e66b8832 100644 --- a/examples/textures/textures_rectangle.c +++ b/examples/textures/textures_sprite_anim.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [textures] example - Texture loading and drawing a part defined by a rectangle +* raylib [textures] example - Sprite animation * * This example has been created using raylib 1.3 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -24,7 +24,7 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; - InitWindow(screenWidth, screenHeight, "raylib [texture] example - texture rectangle"); + InitWindow(screenWidth, screenHeight, "raylib [texture] example - sprite anim"); // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading @@ -56,6 +56,7 @@ int main(void) frameRec.x = (float)currentFrame*(float)scarfy.width/6; } + // Control frames speed if (IsKeyPressed(KEY_RIGHT)) framesSpeed++; else if (IsKeyPressed(KEY_LEFT)) framesSpeed--; diff --git a/examples/textures/textures_rectangle.png b/examples/textures/textures_sprite_anim.png similarity index 100% rename from examples/textures/textures_rectangle.png rename to examples/textures/textures_sprite_anim.png diff --git a/projects/VS2019/examples/textures_rectangle.vcxproj b/projects/VS2019/examples/textures_sprite_anim.vcxproj similarity index 99% rename from projects/VS2019/examples/textures_rectangle.vcxproj rename to projects/VS2019/examples/textures_sprite_anim.vcxproj index a4736962d..32db8858a 100644 --- a/projects/VS2019/examples/textures_rectangle.vcxproj +++ b/projects/VS2019/examples/textures_sprite_anim.vcxproj @@ -37,9 +37,9 @@ {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC} Win32Proj - textures_rectangle + textures_sprite_anim 10.0 - textures_rectangle + textures_sprite_anim @@ -374,7 +374,7 @@ - + diff --git a/projects/VS2019/raylib.sln b/projects/VS2019/raylib.sln index 4b37ca3d8..fba26af01 100644 --- a/projects/VS2019/raylib.sln +++ b/projects/VS2019/raylib.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{87 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_rectangle", "examples\textures_rectangle.vcxproj", "{C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_sprite_anim", "examples\textures_sprite_anim.vcxproj", "{C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_srcrec_dstrec", "examples\textures_srcrec_dstrec.vcxproj", "{103B292B-049B-4B15-85A1-9F902840DB2C}" EndProject diff --git a/projects/VS2022/examples/textures_rectangle.vcxproj b/projects/VS2022/examples/textures_sprite_anim.vcxproj similarity index 99% rename from projects/VS2022/examples/textures_rectangle.vcxproj rename to projects/VS2022/examples/textures_sprite_anim.vcxproj index a4736962d..32db8858a 100644 --- a/projects/VS2022/examples/textures_rectangle.vcxproj +++ b/projects/VS2022/examples/textures_sprite_anim.vcxproj @@ -37,9 +37,9 @@ {C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC} Win32Proj - textures_rectangle + textures_sprite_anim 10.0 - textures_rectangle + textures_sprite_anim @@ -374,7 +374,7 @@ - + diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index ff6681f23..36c312204 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{87 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_rectangle", "examples\textures_rectangle.vcxproj", "{C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_sprite_anim", "examples\textures_sprite_anim.vcxproj", "{C25D2CC6-80CA-4C8A-BE3B-2E0F4EA5D0CC}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "textures_srcrec_dstrec", "examples\textures_srcrec_dstrec.vcxproj", "{103B292B-049B-4B15-85A1-9F902840DB2C}" EndProject