Je ne comprends pas. J'essaie de mettre mon programme en WindowedScreen(). Quand je le lance, je ne vois que 1 sprite sur 4 et en plus seulement pendant 50 pixels.
Code : Tout sélectionner
;CopyRight Dumli ///\\\
;14/05/2010
InitSprite()
ExamineDesktops()
hImage=CreateImage(0,DesktopWidth(0) ,DesktopHeight(0)) ;Capture d'écran
hDC=StartDrawing(ImageOutput(0))
DeskDC=GetDC_(GetDesktopWindow_())
BitBlt_(hDC,0,0,DesktopWidth(0) ,DesktopHeight(0) ,DeskDC,0,0,#SRCCOPY)
StopDrawing()
ReleaseDC_(GetDesktopWindow_(),DeskDC)
UsePNGImageDecoder()
x1=-25
x2=-25
x3=-25
x4=-25
y1=0
y2=DesktopHeight(0)/4
y3=DesktopHeight(0)/4+DesktopHeight(0)/4
y4=DesktopHeight(0)/4+2*(DesktopHeight(0)/4)
min=70-1
max=140-1
min2=40-1
max2=80-1
vit=2
tx=400
ty=100
If LoadImage(1,"\Pacman01v6.bmp") And LoadImage(2,"\Pacman02v6.bmp") And LoadImage(3,"\Dumli.bmp") ;Charge les 2 positions du PacMan
If OpenWindow(0,0,0,DesktopWidth(0) ,DesktopHeight(0),"",#PB_Window_Tool|#PB_Window_BorderLess)
If OpenWindowedScreen(WindowID(0),0,0,1680 ,1050,0,0,0)
CreateSprite(0,DesktopWidth(0),DesktopHeight(0))
StartDrawing(SpriteOutput(0))
DrawImage(ImageID(0),0,0,DesktopWidth(0),DesktopHeight(0))
StopDrawing()
CreateSprite(1,40,40)
CreateSprite(2,40,40)
CreateSprite(3,40,40)
CreateSprite(4,40,40)
Repeat
FlipBuffers()
ClearScreen(RGB(0,0,0))
DisplaySprite(0,0,0)
DisplayTransparentSprite(1,x1,y1)
DisplayTransparentSprite(2,x2,y2)
DisplayTransparentSprite(3,x3,y3)
DisplayTransparentSprite(4,x4,y4)
If y3<DesktopHeight(0)
If x1<DesktopWidth(0)
x1+vit
x2+vit
x3+vit
x4+vit
If pos>max-5 ;Intitialise la Position de la bouche
pos=0
EndIf
If pos>-1 And pos<min ;Position bouche ouverte
If StartDrawing(SpriteOutput(3))
DrawImage(ImageID(1),x1,y1,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(1))
DrawImage(ImageID(1),x2,y2,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(3))
DrawImage(ImageID(1),x3,y3,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(4))
DrawImage(ImageID(1),x4,y4,40,40)
StopDrawing() : EndIf
pos+2
EndIf
If pos>min And pos<max ;Position bouche fermée
If StartDrawing(SpriteOutput(2))
DrawImage(ImageID(2),x1,y1,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(1))
DrawImage(ImageID(2),x2,y2,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(3))
DrawImage(ImageID(2),x3,y3,40,40)
StopDrawing() : EndIf
If StartDrawing(SpriteOutput(4))
DrawImage(ImageID(2),x4,y4,40,40)
StopDrawing() : EndIf
pos+2
EndIf
Delay(15)
Else ;Intitialise les position en x si x>DesktopWidth()
x1=-25
x2=-25
x3=-25
x4=-25
y1=y1+35
y2=y2+35
y3=y3+35
y4=y4+35
EndIf
Else ;Intitialise les position en y si y>DesktopHeight()
Repeat
Debug pos
If tx<1000
If StartDrawing(WindowOutput(0))
DrawImage(ImageID(3),(DesktopWidth(0)/2)-tx/2,(DesktopHeight(0)/2)-ty/2,tx,ty)
StopDrawing()
EndIf
tx+4
ty+1
Delay(10)
Else
Repeat
x+5
If pos>max2-5 ;Intitialise la Position de la bouche
pos=0
EndIf
If pos>-1 And pos<min2 ;Position bouche ouverte
If StartDrawing(WindowOutput(0))
DrawImage(ImageID(1),x,(DesktopHeight(0)/2)-200/2,200,200)
StopDrawing()
EndIf
pos+2
EndIf
If pos>min2 And pos<max2 ;Position bouche fermée
If StartDrawing(WindowOutput(0))
DrawImage(ImageID(2),x,(DesktopHeight(0)/2)-200/2,200,200)
StopDrawing()
EndIf
pos+2
EndIf
Delay(10)
ForEver
EndIf
ForEver
EndIf
ForEver
EndIf
EndIf
Else
MessageRequester("Error","Can't Load File")
EndIf