GetShapeQuantity
NumberOfBanks = GetShapeQuantity()
 
Parameters: NONE
Returns:

    NumberOfBanks = The totaly number of shape that PB currently has provision for
 

      The GetShapeQuantity function returns the current max number of shapes that PlayBASIC will allow.



FACTS:


     * You can expand the number of shape by using the ShapeQuantity command. It's worth knowing that, the dynamic commands such as GetFreeShape, NewShape will automatically expand the shape table for you.



Mini Tutorial:


      This example runs through and creates all available banks (the default limit),it then resizes then internal max and displays the info back to the user.

  
  
  
; Read and display the current Max number of Shapes
  quantity=GetShapeQuantity()
  Print "Starting Number of Shapes:"+Str$(quantity)
  Print "press any key"
  
; run through and create all the available Shapes
  For lp =1 To quantity
     CreateShape lp,10+lp,5
  Next
  
; Show the user the screen and wait for a key to be pressed
  Sync
  WaitKey
  WaitNoKey
  
  
; Tell PB to expand the number of available Vectors Shapes in memory
  ShapeQuantity quantity+2000
  
; read and display the number of memory Shapes after expansion
  quantity=GetShapeQuantity()
  Print "Starting Number of Shapes:"+Str$(quantity)
  Print "press any key"
  
  
; This code this loops and displays the status and size of
  y=0
  For lp =1 To quantity
     If GetShapeStatus(lp)
        Edges=GetShapeEdges(lp,0)
        Print "Shape Status:"+Str$(lp)+"   Edges:"+Str$(Edges)
     Else
        Print "Shape Status:"+Str$(lp)+" Doesn't Exist Yet"
        
     EndIf
     
     If GetCursorY()> 440
        Print "Press Any Key to Show next page"
        SetCursorY 0
        Sync
        WaitKey
        WaitNoKey
        Cls RGB(0,0,0)
     EndIf
  Next
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitNoKey
  
  



This example would output (This depends upno what version of PB your running, so the result may differ).

  
  Starting Number of Shapes:500
  press any key
  Starting Number of Shapes:2500
  press any key
  
  Shape Status:1   Size:5
  Shape Status:2   Size:5
  Shape Status:3   Size:5
  Shape Status:4   Size:5
  Shape Status:5   Size:5
  etc
  etc etc
  
  
  


 
Related Info: CreateConvexShape | CreateShape | GetFreeShape | LoadShape | NewConvexShape | NewShape | SaveShape | ShapeQuantity :
 


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