ResizeShape
ResizeShape ShapeIndex, NumbOfVertex, NumbOfEdges
 
Parameters:

    ShapeIndex = The Index of the shape you wish to create
    NumbOfVertex = The number of vertex
    NumbOfEdges = The number of edges
Returns: NONE
 

      ResizeShape allows the user change the number of the vertex and edges definitions a shape has. The command is sensitive to existing data, so when expanding the vertex/edge buffers, old data is not lost. However, if you reduce the number of vertex or edges, and one was in use, the you will loose that data.



FACTS:


      * Shape Vertex indexes ranges between zero and MaxVertex-1

      * Shape Edges indexes ranges between zero and MaxEdges-1




Mini Tutorial:


      This example creates a box like shape manually and draws it. Then it resize the shape, and


  
; Create MySHape, with room for 4 vertex and
; 4 edge connections
  MyShape=NewConvexShape(4,4)
  
  
; Create some Box like vertex
  SetShapeVertex MySHape,0,-50,-50
  SetShapeVertex MySHape,1,50,-50
  SetShapeVertex MySHape,2,50,50
  SetShapeVertex MySHape,3,-50,50
  
; Connect the vertex together to form the Boxes
; edges
  SetShapeEdge MyShape,0,0,1
  SetShapeEdge MyShape,1,1,2
  SetShapeEdge MyShape,2,2,3
  SetShapeEdge MyShape,3,3,0
  
  
; Draw the Filled shape
  DrawShape MyShape,100,100,2
  
; Resize the number of vertex and edges in this shape
  ResizeShape MyShape,10,10
  
  
; Now create another set of box like vertex
; create some more vertex
  SetShapeVertex MySHape,5,-20,-20
  SetShapeVertex MySHape,6,20,-20
  SetShapeVertex MySHape,7,20,20
  SetShapeVertex MySHape,8,-20,20
  
; connect inner edges together
  SetShapeEdge MyShape,5,5,6
  SetShapeEdge MyShape,6,6,7
  SetShapeEdge MyShape,7,7,8
  SetShapeEdge MyShape,8,8,5
  
  
; Draw the NEW Filled shape
  DrawShape MyShape,100,300,2
  
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  




      This example outputs,




 
Related Info: CreateShape | GetShapeEdges | GetShapeVerts | MergeShape :
 


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