summaryrefslogtreecommitdiffhomepage
path: root/examples/textures/textures_srcrec_dstrec.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2017-04-14 13:58:39 +0200
committerraysan5 <[email protected]>2017-04-14 13:58:39 +0200
commit4315b82ea7b42b68572f14c595aa46f030d82a43 (patch)
tree4a0faa9a4d6c6904ef67b2a21f63234679b7edc1 /examples/textures/textures_srcrec_dstrec.c
parent82c54449bf4f472d2b46413288c0343e31eae8dc (diff)
downloadraylib-4315b82ea7b42b68572f14c595aa46f030d82a43.tar.gz
raylib-4315b82ea7b42b68572f14c595aa46f030d82a43.zip
Replaced some images and updated examples
Diffstat (limited to 'examples/textures/textures_srcrec_dstrec.c')
-rw-r--r--examples/textures/textures_srcrec_dstrec.c12
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
//--------------------------------------------------------------------------------------