Line
Line X1, Y1, X2, Y2
 
Parameters:

    X1 = The starting X coordinate of the line
    Y1 = The starting Y coordinate of the line
    X2 = The ending X coordinate of the line
    Y2 = The ending Y coordinate of the line
Returns: NONE
 

      Line draws a line of pixels to the current surface. The line is drawn between two supplied coordinates. The first is the starting position and second the ending position. The colour of the pixels is not specified by the command, so the pixels will be drawn in the current INK colour.



FACTS:


      * Line draws the pixels in the current INK colour and InkMode.

      * Line will render to the current surface, except when the user has either CaptureToScene, or CaptureToWorld are activated. In either situation the render request will be added to the scene or world qeues.

      * Lines outside of the surface area (screen or image) it will be clipped to with the viewport area of the surface.





Mini Tutorial:


      Drawing some lines to the screen.

  
  
; start a For/loop that will loop 100 times
  For lp =1 To 100
     
   ; get a random number between 0 and 100
   ;and place it in the variable StartX
     StartX=Rnd(100)
     
   ; get a random number between 0 and 100
   ; and place it in the variable StartY
     StartY=Rnd(100)
     
     
   ; get a random number between 0 and 100
   ; and place it in the variable EndX
     EndX=Rnd(100)
     
   ; get a random number between 0 and 100
   ; and place it in the variable EndY
     EndY=Rnd(100)
     
   ; draw a line to the screen in the
   ; current INK colour
     
     Line StartX,StartY,EndX,EndY
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



 
Related Info: Box | Cls | Dot | GetSurface | GouraudStripH | GouraudStripV | Ink | InkAlpha | InkMode | LineC | LockBuffer | Quad | RGB | TextureStripH | TextureStripV | Tri :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com