ShapeDebug
ShapeDebug ShapeIndex, State
 
Parameters:

    ShapeIndex = The Index of the shape you wish to set the debug property in
    State = The debug state (0=OFF, 1= ON)
Returns: NONE
 

     ShapeDebug turns the shapes debug mode (1)on or (0)off. The debug mode will make PlayBASIC render the shapes bounding radius. The bound radius is the circle that encapsulates the shapes vertices no matter how they're rotated or scaled. This is most useful when working with collisions between shapes or sprites.



FACTS:


      If you modify the shapes vertex and the bounding radius seems wrong, then you'll need to refresh it using the RefreshShape command.





Mini Tutorial:


     

  
  
; Limit the Program to 75 frames per second or less
  SetFPS 75
  
; Create a 6 sized shape polygon with 100 unit radius
  Shape=NewConvexShape(100,6)
  
; Turn debug mode on for this shape
  ShapeDebug Shape,on
  
  
; STart of Test programs main loop
  Do
     
   ; Clear the screen
     Cls RGB(0,0,0)
     
     
   ; Rotate Shapes vertex
     Angle#=WrapAngle(Angle#,1)
     RotateShape Shape,Angle#,1
     
   ; Draw a filled shape in the center
   ; of screen
     DrawShape Shape,400,300,2
     
   ; Check if the space key is pressed ?
     If SpaceKey()=true
        
      ; if the space key is down flip the shapes
      ; debug state
        ShapeDebug Shape,1-GetShapeDebug(Shape)
        
      ; flush the keyboard input
        FlushKeys
        
     EndIf
     
   ; show the screen to the user
     Sync
     
   ; jump back to the do statement to keep program
   ; running
  Loop
  
  




 
Related Info: DrawShape | GetShapeDebug | LineHitShape | PointHitShape | ShapeHitShape :
 


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