Vector Graphics Support

Hello,
This is a set of semi-technical questions regarding vector graphics file support in Corona. Basically trying to load a vector graphics file (via http or locally) and treat it as a raster image (or layer) that can be transformed, image filter, etc.
Wondering if I could do the following with Corona:
* load an external vector image format (i.e. SVG) and treat it as any other DisplayableObject.
Note: I don’t mind even having a hidden webkit view and grabbing the file off the DOM tree (if it can be done)
* Import a Framework project or external library like Cairo (http://cairographics.org/) from an XCode template project. (via build settings)
Note: it would be nice if I could import one or many 3rd party libraries like this and just wrap extern’d C functions with Lua using Lua’s C wrapper convention.

Just trying to figure out if this is possible and how it would have to be done. Not sure if Corona has a pluggable architecture or if it just produces an XCode project that can be tweaked (best option) prior to release. If the latter is the case I think one could just stub out some Lua functions so the simulator doesn’t crash and then import the libraries when building and deploying to the device.

Thanks,
Joe Graham [import]uid: 6769 topic_id: 1054 reply_id: 301054[/import]

Logged case # 213. As of today, you can’t do these, but we do hear these requests frequently. [import]uid: 54 topic_id: 1054 reply_id: 2591[/import]

Hi Joe,

as Eric didn’t answer to your question about if Corona is pluggable or produces an XCode project…

  1. no, it doesn’t produce an XCode project which you could edit. Everything you see in the trial is what you get in the full version, besides access to the 2.0 beta

  2. Corona is pluggable in the sense of that you can try to use other LUA libs like Json4Lua for an example.

Cheers
Michael [import]uid: 5712 topic_id: 1054 reply_id: 2595[/import]

okay well there’s still a third way i mentioned which is to use svg and webkit. is there a way to access DOM elements in a wrapped webkit or something? i will dig more into this framework and see what i can discover. basically looking to do a map view of a massive game board that supports pinch & zoom ala google maps. not ideal to render a resolution dependent raster image but not a showstopper either.

off topic:
how do you test on device and deploy to app store with your developer account if you don’t produce an xcode project? [import]uid: 6769 topic_id: 1054 reply_id: 2598[/import]

When you build for the device, Corona creates a ready to publish app, which you can install easily on your device or publish to the app store. Of course, they say you need XCode installed (why… I can’t see that as I can build for 3.2 (Ipad) which I don’t have installed) and you need a development/adhock/distribution certificate.
But there is no XCode project created when you build for the device. [import]uid: 5712 topic_id: 1054 reply_id: 2599[/import]

I was one of the early posters with this kind of request, way back when. This is starting to sound more encouraging, now that there are more and more developers asking for a more complete implementation of Lua’s require() that loads native code libraries. (heck, I will get down on my knees and beg for it :slight_smile:

I realize it might seem like an exotic feature to newcomers, but this really is the way many of us expect Lua to behave. Among the standard Lua interpreters I’ve seen on any platform that allows shared libraries, they all support the use of require() to load native code libraries. I don’t mean to harp on this too much, but just to clarify it for anyone who isn’t familiar with this feature.

Thanks, Corona staff, for your super efforts to deliver to us the features we need!

Kyle
[import]uid: 6771 topic_id: 1054 reply_id: 2666[/import]

Well the interesting thing is how the binaries are produced. Because there is no XCode (or platform specific) build file or project then the point of adding extra source folders to the build path is nebulous. This is because without linking the source files to the project or somehow associating the libraries we wish to dynamically load at runtime to the final build product then there is no way to access it. Here are some scenarios to illustrate my point:

  1. load a dynamic library or shared object
    issue a.
    without the ability to include binaries as part of the packaged build (iphone .ipa or android install pkg) then you can’t access the file at runtime, this is especially true with the iphone because the filesystems are sandboxed for each application and there is no shared disk space (for all intents and purposes).
    issue b.
    even if issue a. were achievable what does the Lua runtime need in terms of environment variables or headers to access the extern’d functions?
    issue c.
    the library would need to be compiled as a shared object for the target platform and would need to be compiled for the appropriate version (i.e. iphone 2.x, 3.x etc.) i am not sure you can even create shared objects with xcode for the iphone as such. you can create bundles IIRC but there’s a platform specific way to use those.
  2. static linking of 3rd party library
    issue d.
    would need the main.c or some entry point into the application to import the header(s) of the shared library. again no source or build artifacts are produced so how is this possible?

i really think that 3rd party library linking should be the last possible option in this case. perhaps we should just ask for the library we want and there should be an option to include it in our build artifact (i.e. cairo) that way everyone is on the same version of the library. this has already been done for us with the lua interpreter for instance and any other libraries needed to get corona to the point it is at. why not just add another library that would allow for further image processing given the original request is to support vector graphics file formats?

i fully agree that this framework should be extensible, i just think that it needs to mesh with the direction and capabilities of the framework itself. there are alternatives in the middleware space that already support lua and are build project based on the iphone (example: sio2interactive.com). when you start with a build project you can add source paths at will. using the NDK i don’t see why dropping to a more bare-metal framework like sio2 shouldn’t also be readied for the android platform, if cross platform native library lua support is what you are shooting for here.

my request is first and foremost for vector graphics file support adding another feature (lossless transforms) to our list of tools to create more immersive games (or user experience). [import]uid: 6769 topic_id: 1054 reply_id: 2667[/import]