DisplaySprite only displays empty white blocks.
Posted: Sat Feb 15, 2014 9:18 pm
I was just testing out code speed with images and sprites. The code with the images works fine, when I change it to sprites all I get is white blocks. I am assuming it's a fail on my part not a bug.
With Image:
With Sprite:
Also if I uncomment out the **;MySprite = LoadSprite(#PB_Any,"./Media/Devil.png")** and use this instead and switch the SpriteID(0) to SpriteID(MySprite) It keeps saying sprite un-initialised.
**INFO: I am running a Linux box.
With Image:
Code: Select all
InitSprite()
InitKeyboard()
UsePNGImageDecoder()
MyImage = LoadImage(#PB_Any, "./Media/Devil.png")
OpenScreen(800,600,32,"Something...",#PB_Screen_SmartSynchronization)
X.w = 0
Y.w = 0
ClearScreen(RGB(0,0,0))
For c = 1 To 1000
X = Random(798) + 1
Y = Random(598) + 1
StartDrawing(ScreenOutput())
DrawImage(ImageID(MyImage),X,Y)
StopDrawing()
FlipBuffers()
Next
Delay(1000)
End
Code: Select all
InitSprite()
InitKeyboard()
UsePNGImageDecoder()
;MySprite = LoadSprite(#PB_Any,"./Media/Devil.png")
LoadSprite(0,"./Media/Devil.png")
OpenScreen(800,600,32,"Something...",#PB_Screen_SmartSynchronization)
X.w = 0
Y.w = 0
ClearScreen(RGB(0,0,0))
For c = 1 To 1000
X = Random(798) + 1
Y = Random(598) + 1
DisplaySprite(SpriteID(0),X,Y)
FlipBuffers()
Next
Delay(1000)
End
**INFO: I am running a Linux box.