Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can I import an existing LUA project?

edited July 2013 in General Posts: 5

Hi there

I'm so excited to have discovered Codea. It's the only software that allows you to test an app on an ipad without paying Apple. This is a huge plus when teaching students, as they can get a feel for how their design works on a real device.

I wonder if there is any way of importing an existing project, or project files from an SDK like Corona? Or any other method of importing (even if it's via Dropbox as individual files).

Thanks!

Comments

  • Posts: 1,976

    You could probably go into Codea's files with iExplorer or something, but I'm not sure. And also, Codea isn't the only app that lets you code on iPad.

  • Jmv38Jmv38 Mod
    edited July 2013 Posts: 3,295

    Yeah. Check Pythonista if you know python.
    You can import codea project into codea via a number of method: a link on the web is ok. Check this for instance: http://jmv38.comze.com/CODEAbis/server.php
    There is also a huge number of tutos you'll find in this forum @ignatz or @reefwings).
    But you cannot run programs in other langages, like xcode

  • Thanks for the replies. I'm not sure if you can only import codea projects, or if you can import another lua project (eg. Corona) and all its assets using a gist?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    You can import lua projects that do not use special libraries (include or sockets). You have to try.

  • OK, I'll try. Thank you.
    On your previous point - is Codea the only lua-based ipad coding app?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    There other ones, but codea is the one that provides best graphics support.

  • Great, thanks.

  • Posts: 688

    The problem with importing code from Corona (or Gideros) is that they use a retained mode graphics hierarchy rather than the direct approach that Codea uses.

    If you browse to a gist on your ipad then you can usually copy and paste the text, file (tab) by file (tab), but often times game logic is added in enterframe callbacks on the Corona objects, you'd need to create an object in Codea for each object in your Corona app and then create your own hierarchy so that you could call the correct draw (and update / enterframe) functions in the correct order.

  • Thank you, that's very helpful!

  • GibGib
    Posts: 59

    Hi all, I had started using Corona but recently made the switch to Codea. If I copy and past my code in from my Corona main.lua into a new Codea project, it will highlight what it doesnt understand(ie Corona specific language) and then I can fix/find the equivalient in Codea right? Is that a good approach? Has anyone else done this and if so what was your approach?

    Thanks!

  • dave1707dave1707 Mod
    Posts: 7,533

    @Gib That's what I did with large program that I wrote in C a long time ago. I sent it from my PC to my iPad with email and pasted it into Codea. Then I just kept running the code, fixing the errors as they showed up. Some of the changes were just a matter of fixing the keywords. Others were a little harder because of the different graphic commands. It took awhile to do it, but it was a lot of fun. So yes, it's possible with a little work. Just keep 2 copies. One that's commented out and doesn't change, and the other the one you're changing. That way if you make a change and something doesn't work, you can look at or copy the original section back.

Sign In or Register to comment.