diff options
Diffstat (limited to 'examples/textures/textures_srcrec_dstrec.c')
| -rw-r--r-- | examples/textures/textures_srcrec_dstrec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c index 6d824ce6..53ffd1d0 100644 --- a/examples/textures/textures_srcrec_dstrec.c +++ b/examples/textures/textures_srcrec_dstrec.c @@ -21,10 +21,10 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [textures] examples - texture source and destination rectangles"); // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) - Texture2D guybrush = LoadTexture("resources/guybrush.png"); // Texture loading + Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading - int frameWidth = guybrush.width/7; - int frameHeight = guybrush.height; + int frameWidth = scarfy.width/6; + int frameHeight = scarfy.height; // NOTE: Source rectangle (part of the texture to use for drawing) Rectangle sourceRec = { 0, 0, frameWidth, frameHeight }; @@ -59,10 +59,12 @@ int main() // destRec defines the rectangle where our texture part will fit (scaling it to fit) // origin defines the point of the texture used as reference for rotation and scaling // rotation defines the texture rotation (using origin as rotation point) - DrawTexturePro(guybrush, sourceRec, destRec, origin, rotation, WHITE); + DrawTexturePro(scarfy, sourceRec, destRec, origin, rotation, WHITE); DrawLine(destRec.x, 0, destRec.x, screenHeight, GRAY); DrawLine(0, destRec.y, screenWidth, destRec.y, GRAY); + + DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY); EndDrawing(); //---------------------------------------------------------------------------------- @@ -70,7 +72,7 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - UnloadTexture(guybrush); // Texture unloading + UnloadTexture(scarfy); // Texture unloading CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- |
