Page 1 of 1

DrawVectorText() doesn't move Cursor-Position automatically

Posted: Mon Jan 05, 2026 4:06 pm
by Hoessi666
In the Manual it is written that the Cursor-Position ist updated automatically, but instead Purebasic doesn't write anything/overwrites/... You have to update the Position manually....:

Code: Select all

If OpenWindow(0, 0, 0, 800, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 0, 0, 800, 200)
    LoadFont(0, "Times New Roman", 20)
    
    If StartVectorDrawing(CanvasVectorOutput(0))
    
      VectorFont(FontID(0), 25)
      VectorSourceColor(RGBA(0, 0, 0, 255))
      Text.s = "The quick brown Fox jumps over the lazy Dog."
      
      TAmount=CountString(Text, " ")+1
      For i=1 To TAmount
        
        TempText.s=StringField(Text, i, " ")
        MovePathCursor(0,0, #PB_Path_Relative) ; Comment this out for the Difference
        DrawVectorText(TempText+" ")
        
      Next
          
      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf