Vizrt Get x and y coordinates from .txt file

Dim NewCont As Container = this.PreviousContainer

Dim filePath = "<full path of .txt file>"

Dim text As String
Dim i, xpos, ypos As Integer

this.DeleteChildren()

if System.LoadTextFile(filePath, text) then
    Dim lines As Array[String]
    Dim coord As Array[String]
    text.trim()
    text.split(Chr(10), lines)
    Dim cont As Container
    for i=lines.LBound to lines.UBound
        lines[i].Split(";", coord)
        'println CDbl(coord[0])
        'println CDbl(coord[1])
        xpos = CInt(coord[0])
        ypos = CInt(coord[1])
        cont = NewCont.CopyTo(this, TL_DOWN)
        cont.name = "Circle_"&CStr(i)
        'cont.SetScreenPositionOrtho(xpos,ypos)
        cont.position.x = xpos
        cont.position.y = -ypos
        cont.MoveTo(this.LastChildContainer, TL_NEXT)
    next
end if

Scene.UpdateSceneTree()

 

 

Shopping Cart