summaryrefslogtreecommitdiffhomepage
path: root/examples/textures_rectangle.c
diff options
context:
space:
mode:
authorRay <[email protected]>2017-04-04 01:54:49 +0200
committerRay <[email protected]>2017-04-04 01:54:49 +0200
commitdd4dd0e87d7d215a21b8fc129cbe1adc4b96afe8 (patch)
tree724f11991d301fc8bfd01ccd13321f66d8969329 /examples/textures_rectangle.c
parent5a230659ef39c6eb3bdb5412ca6e1bfc9eeda98e (diff)
downloadraylib-dd4dd0e87d7d215a21b8fc129cbe1adc4b96afe8.tar.gz
raylib-dd4dd0e87d7d215a21b8fc129cbe1adc4b96afe8.zip
Reorganize examples folder
Diffstat (limited to 'examples/textures_rectangle.c')
-rw-r--r--examples/textures_rectangle.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/examples/textures_rectangle.c b/examples/textures_rectangle.c
deleted file mode 100644
index cca5b216..00000000
--- a/examples/textures_rectangle.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************************
-*
-* raylib [textures] example - Texture loading and drawing a part defined by a rectangle
-*
-* 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)
-*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
-*
-********************************************************************************************/
-
-#include "raylib.h"
-
-int main()
-{
- // Initialization
- //--------------------------------------------------------------------------------------
- int screenWidth = 800;
- int screenHeight = 450;
-
- InitWindow(screenWidth, screenHeight, "raylib [texture] example - texture rectangle");
-
- // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
- Texture2D guybrush = LoadTexture("resources/guybrush.png"); // Texture loading
-
- Vector2 position = { 350.0f, 240.0f };
- Rectangle frameRec = { 0, 0, guybrush.width/7, guybrush.height };
- int currentFrame = 0;
- //--------------------------------------------------------------------------------------
-
- // Main game loop
- while (!WindowShouldClose()) // Detect window close button or ESC key
- {
- // Update
- //----------------------------------------------------------------------------------
- if (IsKeyPressed(KEY_RIGHT))
- {
- currentFrame++;
-
- if (currentFrame > 6) currentFrame = 0;
-
- frameRec.x = currentFrame*guybrush.width/7;
- }
- //----------------------------------------------------------------------------------
-
- // Draw
- //----------------------------------------------------------------------------------
- BeginDrawing();
-
- ClearBackground(RAYWHITE);
-
- DrawTexture(guybrush, 35, 40, WHITE);
- DrawRectangleLines(35, 40, guybrush.width, guybrush.height, LIME);
-
- DrawTextureRec(guybrush, frameRec, position, WHITE); // Draw part of the texture
-
- DrawRectangleLines(35 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RED);
-
- DrawText("PRESS RIGHT KEY to", 540, 310, 10, GRAY);
- DrawText("CHANGE DRAWING RECTANGLE", 520, 330, 10, GRAY);
-
- DrawText("Guybrush Ulysses Threepwood,", 100, 300, 10, GRAY);
- DrawText("main character of the Monkey Island series", 80, 320, 10, GRAY);
- DrawText("of computer adventure games by LucasArts.", 80, 340, 10, GRAY);
-
- EndDrawing();
- //----------------------------------------------------------------------------------
- }
-
- // De-Initialization
- //--------------------------------------------------------------------------------------
- UnloadTexture(guybrush); // Texture unloading
-
- CloseWindow(); // Close window and OpenGL context
- //--------------------------------------------------------------------------------------
-
- return 0;
-} \ No newline at end of file