PathLength()

Syntaxe

Resultat.d = PathLength()
Description
Renvoie la longueur totale du chemin du dessin vectoriel en cours.

Arguments

Aucun.

Valeur de retour

Renvoie la longueur du chemin courant.

Exemple

  If OpenWindow(0, 0, 0, 400, 200, "PathLength", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 0, 0, 400, 200)

    If StartVectorDrawing(CanvasVectorOutput(0))
    
      ; construction du chemin
      MovePathCursor(150, 125)
      AddPathCurve(0, 270, 0, -150, 350, 180)
      
      ; longueur du chemin
      Debug "Path length: " + PathLength()

      ; dessin du chemin
      VectorSourceColor($FF0000FF)
      StrokePath(5)

      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

Voir aussi

PathPointX(), PathPointY(), PathPointAngle()

OS Supportés

Tous

<- PathCursorY() - VectorDrawing Index - PathPointAngle() ->