GetShapeEdgeStatus
Flag = GetShapeEdgeStatus(ShapeIndex, EdgeIndex)
 
Parameters:

    ShapeIndex = The Index of the shape you wish to query
    EdgeIndex = The index of the edge you wish to query within the shape
Returns:

    Flag = The state of this edge (0=off, 1=on)
 

     The GetShapeEdgeStatus function returns the start or end vertex index from a shapes edge.



FACTS:


     * None



Mini Tutorial:


      This example creates a shape, set it's vertex and edges and displays both the vertex set and edges that were defined


  
; Create the shape, with space for 5 edges and 10 vertex
  MyShape=NewShape(5,10)
  
; Set the 5 vertex positions in this shape
; Set vertex #1, -50x,-50y
  SetShapeVertex MySHape,1,-50,-50
  SetShapeVertex MySHape,2,50,-50
  SetShapeVertex MySHape,3,50,50
  SetShapeVertex MySHape,4,-50,50
  
  Print "====================="
  Print "Vertex..............."
  Print "====================="
  
; Render the SHapes Vertex
  For lp=1 To 4
   ;Get the Index of this edges Vertex1
     Xpos=GetShapeVertexX(Myshape,lp)
   ;Get the Index of this edges Vertex1
     Ypos=GetShapeVertexY(Myshape,lp)
   ; Display the X/Y pos of this vertex
     Print Str$(Xpos)+", "+Str$(ypos)
  Next
  
; Connect the vertex together to form the edges
; Connect outter edges
  SetShapeEdge MyShape,1,1,2
  SetShapeEdge MyShape,2,2,3
  SetShapeEdge MyShape,3,3,4
  SetShapeEdge MyShape,4,4,1
  
  Print "====================="
  Print "Edges..............."
  Print "====================="
  
; Render the SHapes edges
  For lp=1 To 4
   ; Check if this Edge has been set.
     If GetShapeEdgeStatus(MyShape,lp)=true
      ;Get the Index of this edges Vertex1
        VertIndex1=GetShapeEdge(Myshape,lp,0)
      ;Get the Index of this edges Vertex1
        VertIndex2=GetShapeEdge(Myshape,lp,1)
        
      ; Display what vertex this edge connects
        Print Str$(VertIndex1)+"-"+Str$(VertIndex2)
     EndIf
  Next
  
  DrawShape MyShape,400,100,2
  
  
  Sync
  WaitKey
  




This example would output.

  
  ====================
  Vertex...............
  ====================
  -50-50
  50-50
  5050
  -5050
  ====================
  Edges...............
  ====================
  1-2
  2-3
  3-4
  4-1
  

 
Related Info: GetShapeEdge | GetShapeVertexX | GetShapeVertexY | SetShapeEdge | SetShapeVertex :
 


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