I'm finally trying to use this little essential tool here:
https://forum.thegamecreators.com/thread/194938
I got so far as to draw a vector shape and export it as a .shp file. So far so good.
Then I tried putting this code in my game:
function loadSpriteShape(shapeFile$, spr)
rem read the contents and create the shape
i=getSpriteImageID(spr)
scaleX# = (getSpriteWidth(spr)*pw)/(getImageWidth(i)*pw)
scaleY# = (getSpriteHeight(spr)*ph)/(getImageHeight(i)*ph)
filenum = openToRead(shapeFile$)
nul$ = readLine(filenum)
shapes = val(readLine(filenum))
dim shp[shapes] as dataType
points=0
for i=1 to shapes
nul$ = readLine(filenum)
nul$ = readLine(filenum)
totalnum = val(readLine(filenum))
shp[i].s = points+1
shp[i].f = points+totalnum
for x=1 to totalnum
points = points+1
dim point[points] as pointType
nul$ = readLine(filenum)
pntx# = FloatVal(readLine(filenum))*scaleX#
pnty# = FloatVal(readLine(filenum))*scaleY#
addSpriteShapePolygon(spr,totalnum,x-1,pntx#,pnty#)
point[points].x = pntx#+sw*0.5
point[points].y = pnty#+sh*0.5
next
next
closeFile(filenum)
endfunction
But when it reaches this line
dim shp[shapes] as dataType
it throws an error saying that shapes have not been defined. What to do here?