GetShapeVerts
NumberOfVertexs = GetShapeVerts(ShapeIndex, [VertexSelect=0])
 
Parameters:

    ShapeIndex = The Index of the shape you wish to query
    [VertexSelect=0] = A toggle to select the total available vertex, or the highest used vertex
Returns:

    NumberOfVertexs= The number of vertex in this shape
 

      The GetShapeVerts function can return two vertex values. It can either return the total number of vertex a shape has, or the highest vertex index that is in use.

      The VertexSelect parameter is optional. It defaults to 0, in this mode the command returns the Absolute number of vertex in the shape. Setting it to 1 makes the function return the highest used vertex index.



FACTS:


      * If no edges are in use, the function will return a -1 for the highest used vertex.



Mini Tutorial:


      This example displays the max and used number of edges and vertex.


  
  
; Create a new shape with space for 5 vertex and 10 edges
  MyShape=NewShape(5,10)
  
; Set edge 6 (out of 10) to use vertex 3 and 4
  SetShapeEdge MyShape,6,3,4
  
; Display the number of Vertex
  Print "Numb Of Vertex:"+Str$(GetShapeVerts(MyShape,0))
  Print "Highest Used Vertex:"+Str$(GetShapeVerts(MyShape,1))
  
; Display the number of edges
  Print "Numb Of Edges:"+Str$(GetShapeEdges(MyShape,0))
  Print "Highest Used Edge:"+Str$(GetShapeEdges(MyShape,1))
  
  
; Display the screen and wait for the user to press a key
  Sync
  WaitKey
  
  




This example would output.

  
  Numb Of Vertex:5
  Numb Of Used Vertex:4
  Numb Of Edges:10
  Numb Of Used Edges:6
  


 
Related Info: CreateConvexShape | CreateShape | GetShapeEdges | LoadShape | NewConvexShape | NewShape | SaveShape :
 


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