Seite 1 von 1

SkinWinFast mit WindowedScreen und Sprites

Verfasst: 15.01.2006 21:03
von rayman1970
Hi !
Ich habe mal gerade eben ein bisschen mit SkinWinFast rum gespielt :-)
Vielleicht kann es ja einer gebrauchen .
Auf Optimierung habe ich allerdings jetzt nicht geachtet .

Viel Spass damit !

Gruss Rayman

Code: Alles auswählen

; SkinWinFast mit WindowedScreen und Sprites / Code By RayMan1970 

InitSprite()

;{ ******** Hier wird der Hintergrund erstellt für SkinWinFast ********
CreateImage(1, 300, 300) 
StartDrawing( ImageOutput() )
 Box(0,0,300,300, RGB(125,125,125)) ; Das hier wird transparent


Circle(150,150,140,RGB(126,125,125) ) ; Der normale Hintergrund

Circle(150,150,40,RGB(125,125,125) )  ; Das hier wird transparent

StopDrawing()
;} ********************************************************************


OpenWindow(0,0,0,300,300,  #PB_Window_BorderLess | #PB_Window_ScreenCentered ,"WindowedScreen")
OpenWindowedScreen(WindowID(),0,0,300,300,0,0,0) 


SkinWindow(WindowID(),ImageID(),0,0)

;{ ************** Hier wird das Sprite erstellt ***************
CreateSprite(1, 100, 100, 0)
StartDrawing( SpriteOutput(1) )
For i=50 To 5 Step -3
 Circle(50,50,i,RGB(Random(255),Random(255),Random(255) ))
Next i
StopDrawing()
;} ************************************************************

x=134 : a=-4 : y=0 :b=4

Repeat
  event=WindowEvent()
  Delay(5) 

 
  StartDrawing( ScreenOutput() )
  For i=0 To 300
  LineXY(i,0,i,300, RGB(i/2,i/2,i/2) )
  Next i
  FrontColor(255,100,100)
  DrawingMode(1)
  Locate(110,250)
  DrawText("Ende mit ESC")
  StopDrawing()
  
  
  
  x=x+a : y=y+b
  If x>200 Or x<0 : a=-a : EndIf
  If y>200 Or y<0 : b=-b : EndIf
  
  

DisplayTranslucideSprite(1, x, y, 255)

If event=#WM_LBUTTONDOWN 
 SendMessage_(WindowID(),#WM_NCLBUTTONDOWN, #HTCAPTION,0)
EndIf
 
FlipBuffers()
  
Until GetAsyncKeyState_(#VK_ESCAPE)

FreeWindowSkin(WindowID())