aboutsummaryrefslogtreecommitdiff
path: root/examples/textures_rectangle.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2014-09-21 14:26:42 +0200
committerraysan5 <raysan5@gmail.com>2014-09-21 14:26:42 +0200
commit5ecb6801fa5bf4f59a4459adfda922169523567f (patch)
tree0516a772c0efaccfb9980b5d6620b903ffddc1b2 /examples/textures_rectangle.c
parent3a0d164a768a7c4ec1e5f56ddfc005182f8a86eb (diff)
downloadraylib-5ecb6801fa5bf4f59a4459adfda922169523567f.tar.gz
raylib-5ecb6801fa5bf4f59a4459adfda922169523567f.zip
Examples renaming and test examples merge
Examples have been renamed for coherence with raylib modules and test examples have been merged into examples folder.
Diffstat (limited to 'examples/textures_rectangle.c')
-rw-r--r--examples/textures_rectangle.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/examples/textures_rectangle.c b/examples/textures_rectangle.c
index 5836e7a9..95caf0a4 100644
--- a/examples/textures_rectangle.c
+++ b/examples/textures_rectangle.c
@@ -1,11 +1,11 @@
/*******************************************************************************************
*
-* raylib example 04b - Texture loading and drawing a part defined by a rectangle
+* raylib [textures] example - Texture loading and drawing a part defined by a rectangle
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2013 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com)
*
********************************************************************************************/
@@ -17,21 +17,17 @@ int main()
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib [texture] example - texture rectangle");
const char textLine1[] = "Lena image is a standard test image which has been in use since 1973.";
- const char textLine2[] = "It comprises 512x512 pixels, and was originally cropped from the centerfold";
- const char textLine3[] = "of November 1972 issue of Playboy magazine. The image is probably the most";
- const char textLine4[] = "widely used test image for all sorts of image processing algorithms.";
+ const char textLine2[] = "It comprises 512x512 pixels, and it is probably the most widely used";
+ const char textLine3[] = "test image for all sorts of image processing algorithms.";
- InitWindow(screenWidth, screenHeight, "raylib example 04b - texture rectangle");
-
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Texture2D texture = LoadTexture("resources/lena.png"); // Texture loading
- Color halfTrans = WHITE;
- halfTrans.a = 30;
-
- Rectangle eyesRec = { 225, 240, 155, 50 };
+ Rectangle eyesRec = { 225, 240, 155, 50 }; // Part of the texture to draw
Vector2 position = { 369, 241 };
//--------------------------------------------------------------------------------------
@@ -51,14 +47,13 @@ int main()
DrawText("LENA", 220, 100, 20, PINK);
- DrawTexture(texture, screenWidth/2 - 256, 0, halfTrans); // Draw background image
+ DrawTexture(texture, screenWidth/2 - 256, 0, Fade(WHITE, 0.1f)); // Draw background image
DrawTextureRec(texture, eyesRec, position, WHITE); // Draw eyes part of image
DrawText(textLine1, 220, 140, 10, DARKGRAY);
DrawText(textLine2, 220, 160, 10, DARKGRAY);
DrawText(textLine3, 220, 180, 10, DARKGRAY);
- DrawText(textLine4, 220, 200, 10, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -72,4 +67,4 @@ int main()
//--------------------------------------------------------------------------------------
return 0;
-}
+} \ No newline at end of file