TÖVE display large svg issue [SOLVED]

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
pbergaus
Prole
Posts: 2
Joined: Sun Jun 11, 2023 7:13 pm

TÖVE display large svg issue [SOLVED]

Post by pbergaus »

Hello,

I have an issue with displaying large svg files. What do I have to check that an svg file is displayed?
When I
graphics = tove.newGraphics(svgData, 200)
-> Does this scale every size to 200px on the canvas?

I exported a png file with a procedurally generated town.
In gimp I created paths by selecting colors nad exported them to svg.
In Inkscape I exploded the paths and put them into the groups.
I did export the svg file as plain svg.

Is the structure of the svg file bad?


Here are the files:
freilerten_pfade_plain.svg.txt
(304.23 KiB) Downloaded 87 times
Main.lua
(544 Bytes) Downloaded 78 times
conf.lua
(163 Bytes) Downloaded 76 times
Thanks
Philipp
Last edited by pbergaus on Sun Jun 11, 2023 8:59 pm, edited 1 time in total.
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: TÖVE display large svg issue

Post by Andlac028 »

I didn’t saw the file in Inkscape, but I think 312kB is really big for svg. Aren’t there many unnecesarry nodes (very likely when using exported paths from png)? Try to simplify it with Inkscape’s path simplify (or how it’s called) or use some kind of online svg minimizers to simplify paths a bit.
pbergaus
Prole
Posts: 2
Joined: Sun Jun 11, 2023 7:13 pm

Re: TÖVE display large svg issue [SOLVED]

Post by pbergaus »

Hello,

thanks for the quick reply.

Yes the file is relatively large, but that was not the issue.
The filling was not set, so it was "black" and not visible. When changing/setting fill to "white" the content was visible.

Thanks
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 57 guests