Code: Select all
Enumeration
#windowMain
#sprite_PlayerIdle01
EndEnumeration
; the usual init stuff here
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7 or later", 0)
End
EndIf
; opening a window...
If OpenWindow(#windowMain,20,30,640,480,"Test") = 0
MessageRequester("Error","Window",0)
EndIf
; setting up a windowed screen
If OpenWindowedScreen(WindowID(#windowMain),5,5,320,300,0,0,0)
LoadSprite(#sprite_PlayerIdle01, "imgs\playerSprite01.png", 0)
; ^ yes, the filename is valid.
Repeat
FlipBuffers()
; i know, the order is a bit awkward but that's not my problem (or is it?)
ClearScreen(RGB(0,0,0))
DisplaySprite(#sprite_PlayerIdle01, 100, 100)
;^ Here's the ERROR: "#Sprite Object not initialized." wtf?
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Up)
Quit = 1
EndIf
Until Quit = 1
EndIf
Phil