richard 2022-09-23 20:11:59 +01:00
parent 84c7eff4d7
commit 2c233d47fa
2 changed files with 20 additions and 19 deletions

View file

@ -0,0 +1,31 @@
from raylib import *
screenWidth = 800
screenHeight = 450
InitWindow(screenWidth, screenHeight, b"raylib [textures] example - image loading")
image = LoadImage(b"examples/textures/resources/raylib_logo.jpg")
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()