Replaced some images and updated examples
This commit is contained in:
parent
82c54449bf
commit
4315b82ea7
10 changed files with 29 additions and 28 deletions
|
@ -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
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue