Line3DXY(x_depart, y_depart, z_depart, x_arrivé, y_arrivé, z_arrivé, Couleur,nombre de points)
Code : Tout sélectionner
#dobro=1
#Police=1
#Sprite=1
Declare comtoisLinexy(xi,yi,xf,yf,CoulR,CoulG,CoulB)
; ***********************************
Resultat = InitSprite()
FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran
EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran
WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello",#PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(1)
Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0)
phrase$="D,o,b,r,o, ,v,o,u,s, ,S,a,l,u,e, ,e,t, ,v,o,u,s, ,s,o,u,h,a,i,t,e, ,d,e, ,B,o,n,n,e, ,V,a,c,a,n,c,e,s, ,a, ,T,o,u,s"
; creation d'un Sprite
For t=1 To Len(phrase$)
caractere$ = StringField(phrase$, t, ",")
CreateSprite(t, 80, 80) ; cree un sprite
StartDrawing(SpriteOutput(t) ) ; on dessine dedans
DrawingMode(1) ; fond transparent
FrontColor(RGB(255, 255,255)); caratere blanc
DrawingFont(FontID)
DrawText(1,1,caractere$)
Debug caractere$
StopDrawing()
spr+1 ; nbr de sprite
Next t
spr=spr/2
Resultat = InitMouse()
Repeat
ExamineMouse()
Event=WaitWindowEvent()
StartDrawing( ScreenOutput())
x1=0
y1=0
x2=500
y2=500
comtoisLinexy( 0, 0, 500, 500,255,255,255)
StopDrawing()
; x= MouseX()
; y= MouseY()
;
FlipBuffers():; affiche l'ecran
; ClearScreen(0, 0, 0) :;efface l'ecran
Event=WindowEvent() ;}
If MouseButton(2)
End
EndIf
Until Event=#PB_Event_CloseWindow
Procedure comtoisLinexy(xi,yi,xf,yf,CoulR,CoulG,CoulB)
; StartDrawing(ScreenOutput())
FrontColor(RGB(CoulR,CoulG,CoulB))
x = xi
Y = yi
dx = xf - xi
dy = yf - yi
If dx > 0
xinc = 1
Else
xinc = -1
EndIf
If dy > 0
yinc = 1
Else
yinc = -1
EndIf
dx = Abs(dx)
dy = Abs(dy)
Plot(x,Y)
If dx > dy
cumul = dx / 2
For i = 1 To dx
x + xinc
cumul + dy
If (cumul >= dx)
cumul - dx
Y + yinc
EndIf
Plot(x,Y)
Next
Else
cumul = dy / 2
For i = 1 To dy
Y + yinc
cumul + dx
If cumul >= dy
cumul - dy
x + xinc
EndIf
Plot(x,Y)
Next
EndIf
DrawText(10,10,"click bouton droit pour quitter",RGB(255,255,255),RGB(0,0,0))
; StopDrawing()
EndProcedure