Idem en en openwindowscreen
Avez vous une solution ?
Code : Tout sélectionner
;
; ------------------------------------------------------------
;
; PureBasic - Sprite example file
;
; (c) 2013 - Fantaisie Software
;
; ------------------------------------------------------------
;
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
MessageRequester("Error", "Sprite system can't be initialized", 0)
End
EndIf
;
; Now, open a 800*600 - 32 bits screen
;
If OpenScreen(800, 600, 32, "Sprite")
; Load our 16 bit sprite (which is a 24 bit picture in fact, as BMP doesn't support 16 bit format)
;
; Votre chemin vers data
LoadSprite(0, "I:/PROG/Purebasic_5.21_LTS/Examples/Sources/Data/PureBasic.bmp", 0)
CopySprite(0,1,0)
; CURSEUR
CopySprite(0,2,0)
ClipSprite(2, 0, 0, 50, 50)
Repeat
; Inverse the buffers (the back become the front (visible)... And we can do the rendering on the back)
ExamineMouse()
FlipBuffers()
ClearScreen(RGB(0,0,0))
; Draw our sprite
ClipSprite(0, 0, 0, x, x/8)
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
; CURSEUR
DisplaySprite(2,MouseX(), MouseY())
x+1
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
EndIf
End