tidy examples
This commit is contained in:
parent
eb68dec2ad
commit
70b8d7c143
12 changed files with 120 additions and 6 deletions
27
examples/textures/textures_image_loading.py
Normal file
27
examples/textures/textures_image_loading.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from raylib import *
|
||||
|
||||
screenWidth = 800
|
||||
screenHeight = 450
|
||||
|
||||
InitWindow(screenWidth, screenHeight, b"raylib [textures] example - image loading")
|
||||
|
||||
image = LoadImage(b"resources/raylib_logo.png")
|
||||
texture = LoadTextureFromImage(image)
|
||||
|
||||
UnloadImage(image)
|
||||
|
||||
while not WindowShouldClose():
|
||||
|
||||
BeginDrawing()
|
||||
|
||||
ClearBackground(RAYWHITE)
|
||||
|
||||
DrawTexture(texture, int(screenWidth/2 - texture.width/2), int(screenHeight/2 - texture.height/2), WHITE)
|
||||
|
||||
DrawText(b"this IS a texture loaded from an image!", 300, 370, 10, GRAY)
|
||||
|
||||
EndDrawing()
|
||||
|
||||
UnloadTexture(texture)
|
||||
|
||||
CloseWindow()
|
Reference in a new issue