Code: Select all
OpenScreen(800, 600, 32, "Test Sprites")
Procedure RenderFrame()
DisplayTransparentSprite(1, 400, 300)
FlipBuffers()
EndProcedure
Procedure Loading(Type, Filename$)
Static NbLoadedElements
NbLoadedElements+1
If NbLoadedElements = 1
ClearScreen(RGB(218, 165, 32))
FlipBuffers()
EndIf
EndProcedure
Procedure LoadingError(Type, Filename$)
Debug Filename$ + ": loading error"
EndProcedure
; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loading())
BindEvent(#PB_Event_LoadingError, @LoadingError())
BindEvent(#PB_Event_RenderFrame, @RenderFrame())
LoadSprite(1, "Data/spider.png")
Code: Select all
OpenScreen(800, 600, 32, "Test Sprites")
Procedure RenderFrame()
DisplayTransparentSprite(spider, 400, 300)
FlipBuffers()
EndProcedure
Procedure Loading(Type, Filename$)
Static NbLoadedElements
NbLoadedElements+1
If NbLoadedElements = 1
ClearScreen(RGB(218, 165, 32))
FlipBuffers()
EndIf
EndProcedure
Procedure LoadingError(Type, Filename$)
Debug Filename$ + ": loading error"
EndProcedure
; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loading())
BindEvent(#PB_Event_LoadingError, @LoadingError())
BindEvent(#PB_Event_RenderFrame, @RenderFrame())
Global spider = LoadSprite(#PB_Any, "Data/spider.png")