Can I use format.SVG in Lime?

asking this because I started a lime project in flashdevelop and now am hitting this head on.

“C:/HaxeToolkit/haxe/lib/svg/1,0,8/format/SVG.hx:4: characters 7-29 : You cannot access the flash package while targeting cpp (for flash.display.Graphics)
src/i/m/a/Main.hx:10: characters 7-17 : referenced here
–macro:1: character 0 : referenced here
Build halted with errors.”

So, SVG in lime is a no go and I need to start a nme project, correct ?
Or is there another way to use an SVG asset in lime and I am just missing this…

If I add:
haxelib name=“openfl"
compilerflag name=”–macro" value=“allowPackage(‘flash’)”

to project.xml and comment out “import lime.Assets;” it runs but puts out:

Could not find primitive lime_system_gettimer__0.

I haven’t tried to load the svg but will try that next, though don’t really know what I am doing. :slight_smile:

EDIT: Nope, that didn’t work, don’t even know where to add the svg to. Anyway, if someone knows of a way to load svg content to a lime project that compiles to cpp bin, please do tell.

SVG require/render to OpenFL’s Graphic. Which obviously Lime doesn’t have, since Lime is a lower level API.

Hi @Franky :smile:

Yep, if you want to use the SVG library with Lime right now, I’d recommend using OpenFL over it.

You’ll likely need to have a Lime NDLL to go along with it, that’s the cause of that error your having.

Take a look at:

This is a minimal application that processes SVG images, in the __init__ is where it sets up paths to find the native Lime binary to support the tool. If you copied the files into your own directory, you could also make a standalone tool that does not require Lime to be installed. However, if it’s alright if the user has Lime installed, you could probably use the code from this example verbatim – just use the binary that comes with their package

Thanks for that, aaulia and singmajesty. Big help setting me on the right track.
Got to look into this a bit more, I see.

Thanks for that link.
Does SQLite run ok with OpenFL, Joshua ? It kind of is just exiting when I try to read the .sqlite database. The same code was running ok on the lime project.
I traced and can see it does the but it doesn’t pass the .request I do after opening.

EDIT: Nevermind that, I was borking up some other place. sqlite runs fine on openfl.

1 Like