GetFreeShape
ShapeIndex = GetFreeShape()
 
Parameters: NONE
Returns:

    ShapeIndex = The Index of a shape that is free to be used
 

      The GetFreeShape function returns the index of a shape that is currently free for use. GetFreeShape doesn't allocate or reserve the index however, so if you called it twice in a row you'd get the same output.



FACTS:


     * GetFreeShape will expand the media range for you, if all index are in use. So the command will always return a free index. However, we generally recommend using the New commands for dynamic media creation today. Which would be commands such as NewShape, NewConvexShape etc See Naming Conventions for more information on PlayBASIC command naming conventions




Mini Tutorial:


      This example requests a free shape index, displays it's status before creating it, creates the shape, and displays it status again.


  
; Define a variable, and grab a free shape Index
  MyShape = GetFreeShape()
  
; Display this shapes index status
  Print GetShapeStatus(MyShape)
  
  
; Create MySHape, with room for 10 vertex and
; 10 edge connections
  CreateShape MyShape,10,10
  
; Display this shapes status
  Print GetShapeStatus(MyShape)
  
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  




This example would output.

  
  0
  1
  

 
Related Info: CreateConvexShape | CreateShape | DeleteShape | GetShapeStatus | NewConvexShape | NewShape | SaveShape | ShapeQuantity :
 


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