GetShapeVertexY
Ypos = GetShapeVertexY(ShapeIndex, VertexIndex)
 
Parameters:

    ShapeIndex = The Index of the shape you wish to query
    VertexIndex = The index of the vertex you wish to query
Returns:

    Ypos = The Y position of this vertex
 

     The GetShapeVertexY function returns the Y coordinate of a shapes vertex.


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
  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
   ;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)
  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: GetShapeVertexX | SetShapeEdge | SetShapeVertex :
 


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