Howdy, Stranger!

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

Codea 1.5.2 Beta

SimeonSimeon Admin Mod
edited March 2013 in Beta Posts: 5,364

Hi Everyone

Codea 1.5.2 brings Xcode Export directly into the Codea app.

This beta contains the export functionality. If you have a Mac with Xcode, please play with this feature and let me know if there are any issues. It should be fairly straight forward to use (much easier than the GitHub runtime) and produce very clean Xcode projects with only the necessary assets required to run your project.

Even if you don't have a Mac, have a go at exporting and let me know what you think of the process.

It also supports project dependencies (though not well tested).

Your initial Xcode builds will download the required libraries from us, subsequent builds of that project will not have to perform the downloads.

Currently the custom icon feature doesn't work, but it should soon.

Tagged:
«1

Comments

  • Posts: 2,161

    To load this in Xcode, will we need to sign up for a developer account (to download the iOS libraries)?

  • SimeonSimeon Admin Mod
    Posts: 5,364

    You can use the iPad / iPhone Simulator without signing up for a developer account. I believe Xcode is free on the Mac App Store.

    To actually compile to your iPad, you will need a developer account for the code signing certificate.

  • Posts: 2,161

    The comments as it is exporting are great! If you want to add a few more "Solving the Riemann Hypothesis" would be my suggestion.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    Added! It was pretty fun writing them.

  • Posts: 2,161

    Oh ... my ... word.

    It worked.

  • Posts: 503

    Nice work! Really easy to export. Tried it with a paint program using meshes and camera, and it works fine. Exported to Google Drive.

    Also nice that it downloads the needed files. Will the runtime be closed source or will it be possible to look at the poetic code behind it all?

    You've done amazing work with Codea, it's so nice to use! Perfect after a long day of coding at work.. :)

  • edited March 2013 Posts: 503

    The play/pause/rewind cassette/take photo/record buttons are visible. But maybe I should just select the displayMode without them? Yup, that removed them, so it's a feature. :)

  • SimeonSimeon Admin Mod
    Posts: 5,364

    .@Andrew_Stacey export worked? Excellent news.

    .@tnlogy that's correct, you can use displayMode(FULLSCREEN_NO_BUTTONS) to hide them. I will also be disabling the triple-tap-to-escape gesture in exported projects (it's not disabled yet).

    I have no problem open sourcing the runtime, the main issue is keeping the code up-to-date, writing scripts to move it out of our submodules and into the public repository, it all takes up a lot of time that I was able to save by using static libraries.

    I would like to add a plugin architecture before the 1.5.2 release, so you can easily add your own Lua bindings to custom Objective-C code. I'm hoping this will satisfy most Codea users.

  • toffertoffer Mod
    Posts: 151

    The export work nice for me, nice job and really great feature !
    But what is the minimum Xcode version targeted. I'm not yet 'Lionified' and I would like to know if there is some tricks to compile the exported project under Snow Leopard.

  • edited March 2013 Posts: 580

    More exporting comment suggestions:


    Reversing the polarity Attenuating the shields Setting weapons to maximum Ejecting Warp Core Venting Plasma Making it so

    Yeah, I watch a lot of Star Trek.

  • Posts: 503

    I have now tried another app, with some sound and tweens. Seems to work fine.

    But when I returned to the app from the home screen, one time the sound didn't work. Haven't been able to reproduce it though, but will tell you if I find out why it happened.

    Sounds good if the runtime will be open sourced. It is not as important to keep the code up to date, but I think there is value in knowing that there is a version of the code to look at, if any issues appear with an App of if twolivesleft gets abducted by aliens. And then of course I'm really curious since the code in the current runtime looks nice. :)

    A plugin architecture sounds nice, it might create a community for adding the features often asked for in the forum.

  • Posts: 1,255

    I'm having trouble with the basic function of closing a program. Hit the leftmost button, and it just toggles pause and play -- I can't escape.

    Export is spiffy. I'll be sitting down this weekend for a "crank a couple of things to the App Store" session, so export will get a workout.

  • Posts: 503

    I guess there is no escape, other than hitting the home buttons, since it's your own app now. Should probably most often just use the FULLSCREEN_NO_BUTTONS, but nice that it's possible to have parameters if you want :)

  • Posts: 580

    Export works great for me, with the exception that it will not export the planet cute sprite pack no matter what I do (including manually selecting it).

  • Posts: 1,255

    Sorry, I wasn't clear. It's not exported programs giving me problem with exiting. Even with the buttons displayed, once I hit run I can't get back to the editor.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    .@Mark are you on iOS 5?

  • Posts: 1,255

    Nope. 6.1.3

  • SimeonSimeon Admin Mod
    Posts: 5,364

    .@Mark that's very odd, I'll look into it. Is this happening to anyone else?

  • Posts: 580

    I'm having this problem as well.

  • edited March 2013 Posts: 580

    .@Simeon It happens when displayMode is FULLSCREEN. The left arrow disappears from the button menu in the left hand corner.

    EDIT: a workaround is to open the console and type close() in the repl

  • SimeonSimeon Admin Mod
    Posts: 5,364

    .@toadkick it happens when you use displayMode(FULLSCREEN) outside of the setup() function. If you put it inside the setup() function then the back button will remain visible. Will be fixed, but that's an alternative workaround for now.

  • Posts: 503

    Haven't been able to reproduce the sound issue I mentioned, so maybe it was just a freak accident. :)

  • Posts: 563

    Finally got a chance to give this a whirl - in a word amazing! The export is really elegant and if you use dropbox or something similar then importing the generated project into Xcode is a trivial exercise. Some observations:

    1. Putting displayMode(FULLSCREEN) inside the setup() function only fixes the back button disappearance in Codea. In the simulator it is still gone. However, this may be intentional as its functionality in Xcode would be ambiguous. It could quit the simulator (i.e. same as cmd q).

    2. Setting the default screens and icons from Codea will be handy. I look forward to seeing how @Simeon produces an elegant way of handling the hundreds of different icon sizes needed (slight exaggeration).

    3. I expect to see a lot more Codea apps in the app store once this version is released.

    4. Next up I will have a play around with IAP, Game Center and iAd to see if these can still be hooked in. At first glance this doesn't seem obvious. I can't see where the LuaState and OSCommand classes have gone! (@Simeon? Runtime Resources?)

  • SimeonSimeon Admin Mod
    edited March 2013 Posts: 5,364

    @Reefwing thanks for your feedback. Glad you like it!

    1. The back button is now dependent on whether Codea has anything to go back to — in the exported projects, it's the only view, so no back button. If you integrate it into an app where you have some previous view, a back button will show up so you can go back. (The fact that it's missing in Codea is a bug, though.)

    2. I will probably just have it generate the following icons from a selected image: Icon-72@2x, Icon-72, Icon@2x and Icon. The rest will have to be taken care of by the user, if they want them. Default screens will be fixed and up to the user to keep or replace on their own (a fairly trivial exercise).

    3. I hope so!

    4. I'll be bringing it back in a much more well-defined way. I'm still considering an API for "plugin" loading. I'm thinking of the following:

    An addition to CodeaViewController:

    - (void) registerAddon:(id<CodeaAddon>)addon withName:(NSString*)name;

    This adds your addon to the Codea Runtime, which then notifies it for the following events:

    @protocol CodeaAddon <NSObject>
     
    //For registering your custom functions and libraries
    - (void) codea:(CodeaViewController*)controller willCreateLuaState:(lua_State*)L;
     
    @optional
     
    //For clean up (if necessary)
    - (void) codea:(CodeaViewController*)controller didCloseLuaState:(lua_State*)L;
     
    //Handling changes to the viewer state (if necessary)
    - (void) codeaPaused:(CodeaViewController*)controller;
    - (void) codeaResumed:(CodeaViewController*)controller;
    - (void) codea:(CodeaViewController*)controller didChangeViewMode:(CodeaViewMode)mode;
     
    //The reset button is pressed, this will cause:
    //  didCloseLuaState and willCreateLuaState to be called again in sequence
    - (void) codeaWillReset:(CodeaViewController*)controller;
     
    //Called before and after a frame is drawn
    - (void) codeaWillUpdateFrame:(CodeaViewController*)controller withDelta:(CGFloat)deltaTime;
    - (void) codeaDidUpdateFrame:(CodeaViewController*)controller withDelta:(CGFloat)deltaTime;
     
    @end

    I'd love to get your feedback on this system.

  • Posts: 503

    Would be interesting to see an example plugin, to get more feel for how it will work. I've just messed with the current objective C files in the old runtime. It will be valuable for customizing the runtime. Good work. :)

  • Posts: 489

    Hello @Simeon. I do not use Xcode much, but the new feature is excellent and seems to work well.

    If Codea 1.5.2 will also fix some bugs, did you see the one reported by @aciolino here? If a vec3 or vec4 uniform is altered in the Shader Lab using the UI sliders then, in the Bindings, the Lua snippet created starts with 'vec2', in error.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @mpilgrem I did see that one, it's in my list of things to fix. Hopefully by the next build.

  • Posts: 563

    .@Simeon - that all makes sense. I like the delegate API pattern that you have suggested. I will put together some examples to see what methods may be required.

  • Posts: 503

    Sounds great @Reefwing, will be interesting to look at.

  • Posts: 1,255

    For what it's worth, I used the 1.5.2 beta and its spiffy XCode export to submit BullPuckey to the app store. Everything went smoothly (other than me typo-ing the bundle idea and having a near panic as I worked out how to change it in XCode to match). So far, so good.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    That's great news @Mark. Kind of the ultimate way to beta test this feature. Hope it goes smoothly.

  • Posts: 1,255

    Clip() appears to be giving me different behavior than earlier versions. (I can't swear it's 1.5.2 that changed as I haven't fiddled with Clip in some time)

    I'm performing a transform in this order Clip(), Transform(), Scale()

    Scaled sprites are appearing outside the are covered by the clip() rectangle.

  • edited March 2013 Posts: 580

    .@Simeon: is there a flag or something exposed to Codea that indicates whether or not the program is running in an exported project rather than in the Codea app? I ask because since the file structure for tabs and dependencies is different in the exported project, I need a way to be able to generate the correct path to a file when not running in the Codea app. If there is not such a flag, so you think you could get one in for 1.5.2?

  • Posts: 489

    Hello @Simeon. A minor bug: searching for 'output' in the in-app reference brings up a duplicate entry.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    .@toadkick good point. I'll add something like an EXPORTED_RUNTIME global.

  • Posts: 489

    Another minor bug: math.pow seems to have been omitted from autocomplete.

  • Posts: 1,255

    Narrowing down the issue with Clip, it appears to behave differently when screen recording is engaged. When recording, clip() doesn't work properly, with a clip boundary that seems to be offset.

  • edited April 2013 Posts: 1,255

    FWIW, I used the export feature to push ScramWords to the App Store. I tried to do the absolute minimum amount of work in XCode. I selected my project in Codea, then selected export and sent the result to myself through email. I then downloaded the attachment and double-clicked to unzip (not even bothering to move the project out of the downloads directory).

    Here are the few things I changed:in XCode.


     

    -- Changed the bundle ID (previously defined on Apple's dev site)

    -- changed the orientation to portrait-only

    -- Substituted my own icon and startup screen images

    -- Changed device support from universal to iPad


     

    I ran it through tests on the simulator a time or two. Then, playing dangerously, I archived it, validated against the App ID I had previously created, and distributed to the App Store without bothering to even download the result onto my iPad.

    Worked dandy, and the app was approved after a five day wait. I'd estimate my time from hitting export to uploading the binary was less than ten minutes.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @Mark glad to hear the export worked! At least one step has improved in the new beta — you can choose the App Icon from your iPad.

    The bundle ID will use a "short form" of the author or company name you include (it will prefer the company name if specified).

    A short version of a name simply removes any spaces or special characters in the name. So "Two Lives Left" becomes "twolivesleft", and the bundle ID then becomes com.twolivesleft.projectShortName

    I'll look at allowing the orientation to be specified. Probably not for 1.5.2 though.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    The new beta includes the above CodeaAddon system. It's simple, and I'm hoping it's enough for everyone to use initially.

  • Posts: 489

    Unrelated to the new features, there appears to be an odd bug with physics.body and setting the mass attribute which is being discussed here.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    Thank you @mpilgrem, I'll ask @John to take a look.

  • Posts: 563

    Hi @Simeon - I wanted to try out the new CodeAddon functionality. Is this documented somewhere? I couldn't see it in the in-app documentation.

  • SimeonSimeon Admin Mod
    edited April 2013 Posts: 5,364

    @Reefwing It's only documented in projects that you export. In the comments of CodeaAddon.h

    I'll post a sample addon shortly. This sort of stuff won't be covered under the in-app reference, as it's Objective-C and a bit beyond the scope of normal Codea use.

    Edit: also note that you will have to delete libcodea.a and libtools.a (in Libs/) if you want to use the addon system in a previously exported project.

  • Posts: 563

    Thanks @Simeon - I can probably work it out from that.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Hello @Simeon.
    I have a problem with recording the video of my app running. I get this:

    When i should get that:
    image
    This seems to be there since the 1.5.2.
    Could you fix it? It is quite annoying, i love to make a quick video to show how my code works, but i cant do that anymore. Thanks in advance.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @Jmv38 Odd! I'll see if I can reproduce it, what build of 1.5.2 did this start happening in?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    I think all. I noticed it at build 4. Thanks.

  • Posts: 563

    I've done a quick tute on exporting your project to Xcode over at http://codeatuts.blogspot.com.au/

    I wont broadcast this to the wider community at this stage. Comments welcome.

    I'm playing with add ons now...

Sign In or Register to comment.