Box
Box X1, Y1, X2, Y2, [FillMode=1]
 
Parameters:

    X1 = The top left hand X coordinate of the box
    Y1 = The top left hand Y coordinate of the box
    X2 = The bottom right hand X coordinate of the box
    Y2 = The bottom right hand Y coordinate of the box
    [FillMode=1] = Toggle for drawnig the rectangle is either open(0) or filled (1)
Returns: NONE
 

      Box draws either a filled or open rectangle to the current surface (Image or Screen).


     Available FILL MODES Values:


0 = Open Box (only draws the edges)
1 = Filled Box



FACTS:


      * Box draws pixels in the current INK colour. PlayBASIC sets the default INK colour to RGB(255,255,255) (white). You can change this at any time by using the INK command.

      * Box draws pixels using the current InkMode.

      * Box will render to the current surface (GetSurface), except when the user has either CaptureToScene, or CaptureToWorld are activated. In either situation the drawing request will be added to the scene or world queues.

      * Box coordinates that fall outside of the current surfaces size or viewport size will be clipped to the area.





Mini Tutorial:


      Draw some random open and filled boxes to the screen.

  
  
; Get the Current Width & Height of the screen
  sw=GetScreenWidth()
  sh=GetScreenHeight()
  
; Set up a FOR/NEXT counting form 0 to 100.  So it'll
; draw 101 boxes
  For lp =0 To 100
     
   ; Set the drawing graphics INK colour to to a random colour
     Ink RndRGB()
     
   ; Draw a box to the screen of random size and either
   ; filled or outlined
     Box Rnd(sw),Rnd(sh),Rnd(sw),Rnd(sh),Rnd(1)
     
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



 
Related Info: BoxC | Cls | Dot | Ink | Line | Quad | QuadC | ShadeBox | TextureQuad | TextureStripH | TextureStripV | TextureTri | Tri | TriC :
 


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