Howdy, Stranger!

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

Codea Scratchpad

SimeonSimeon Admin Mod
edited September 2014 in Beta Posts: 5,363

Hi everyone

You should have seen this on TestFlight recently. If you get a chance to try it, please let me know what you think.

I'm going to take some ideas from the project browser screen to move into the full version of Codea. And I think the ability to swipe back from running projects is vastly superior (even if it means giving up supportedOrientations outside of Xcode export).



  • Jmv38Jmv38 Mod
    Posts: 3,295


  • Posts: 2,161

    How do you swipe back from a running project?

  • BriarfoxBriarfox Mod
    edited September 2014 Posts: 1,542

    @Andrew_Stacey swipe from the left side of the screen to the right. The parameters need to be closed. You can also open parameters and click back.

    @Simeon - Few bugs, First load I tried to run the flappy bird project. Got sound but the screen didn't move. I cleared Codea SP from memory and tried again, it worked. Upon reloading Codea SP the projects changed locations on the screen. I ran Flappy bird again and when I closed it, I got the icon animation on the bouncy balls icon and not the flappy bird icon.

    Looking good. It should really help Spread Codea and lua.

  • Posts: 2,042

    sounds awesome, can't wait to have a look.

    re keeping it secret: I saw it on Codea commits a bit back and I'm sure others did too so they may find out from there

  • Posts: 2,042

    loaded it up: I love the UI. in fact, I think it'd be nice to see this UI move to Codea Full (as well as the neat swipe back to the code)

    first bug: the x button to close the create a project screen doesn't work

  • dave1707dave1707 Mod
    Posts: 8,390

    What would be nice is once a program is started, there is a full screen for graphics, slide the screen to show a full screen for the parameters, slide the screen for a full screen for the print window, and slide the screen for the editor.

  • edited September 2014 Posts: 1,976

    Okay, got it. A few things I should note:

    1. On the page about upgrading, you should add more things that ScratchPad can do or just make it a list of features when you upgrade. Just having one item on the list that says "yes" for Scratchpad looks weird.

    2. Opening and closing projects is being weird. When I open and close a project a different project shows up where I had previously pressed to open the editor, and the icon I had pressed before moves to some other location. Is this intentional?

    3. supportedOrientations() is in the documentation, even though it doesn't do anything.

    4. Sound assets are in the documentation, even though you have none and can't add any. In fact, why not just remove the "documents" in the sound/sprite pickers and jump straight into the sound generator?

    5. How about a TLL logo somewhere with credits and stuff?

    Now for things from Scratchpad I really want in the full Codea:

    1. I love the project browser and I want it in my normal Codea. How about an option in the settings? Maybe for the full Codea, the examples are in a single-file line on the right side and have a bar in between them and yours. Either way, I like Scratchpad's project browser and I want it.

    2. Why is the flappy bird example not in the full version? (Awesome job, by the way.)

    3. The "new project's" menu is very nice. Can I have that in my normal Codea, too? Just maybe with the + icon slightly higher up, it's touching the keyboard and my OCD is bugging me.

  • Posts: 2,820

    This is very, very cool. Here's a few bugs:
    - If you bring up the keyboard in the editor, press the "+" in the top right, tap "Upgrade," press "Done," and then dismiss the popover, the editor still thinks the keyboard is active. The popover also has a weird bug with the arrow being white after dismissing the upgrade screen.
    - Pressing the back button from the code editor screen always shrinks into the "Animation" project.
    - The scrolling in the project navigator is not smooth on my iPad 3 (iOS 8.0.2). It seems to be when you're dequeuing (if you're using a UICollectionView) cells and loading the images for the projects.
    - The corners of the popover on the asset picker in the editor do not match, creating a white edge.
    - In iOS 8, Codea asks for the camera right as every project is run. This is very annoying, especially since apps like StackIt don't the the camera at all, and it asks the user for it right away, which confuses users. I know this isn't directly related to ScratchPad, but I though I might as well bring it up again.
    - The transition to the project play from the editor has some issues (it doesn't completely disappear off the screen).
    I can't applaud you enough for this. It's super cool. Also, I'd suggest adding some complete projects off the forums. I'd be more than willing to share a special version StackIt for this. Or you could integrate Codea Community into this. If you were to simply integrate the most recent projects, that should be pretty easy, in my opinion.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @Briarfox you should be able to swipe while parameters sidebar is open — but if there are any parameter sliders (i.e., parameter.number / integer) then they will take preference. That's weird about the icon issue — if you are able to trigger that bug consistently please let me know.

    @JakAttak that "X" button is actually to clear the text field. You can tap anywhere else to close the new project screen (I might make the X button close the screen if the field is empty too).

    @dave1707 that's a really great idea, though I'm on a short time frame for the first version. I'd like to have it submitted by tomorrow. So this is it for 1.0 feature wise.


    1. good point, I agree.
    2. Yes, the project goes to the top after you open it (it's sorted by recency).
    3. Yes there is now a note stating it is not operational in scratchpad — I think the documentation strings needs to be updated there.
    4. You could potentially add them through iExplorer or other but I agree with you, it's confusing and should go.
    5. Hopefully this can make it in for 1.0

    Regarding the full Codea

    1. The project browser will become the basis of full Codea — except with a search box where the "Upgrade" button is. I'm thinking in full Codea it will be sectioned by recency or some other organisational grouping. (Like folders, or "Recent, "Last Week", "Older"). This will make it easy to manage large collections.
    2. @John just wrote it, so we'll put it in the full one too.
    3. Thanks, I really like the way it turned out. It will come to Codea too.
  • SimeonSimeon Admin Mod
    Posts: 5,363

    @Zoyt thanks! Glad you like it.

    • Weird that it shrinks into the wrong project for you too. I have an iPad mini on iOS 8 and an iPad 3 on iOS 7 and cannot reproduce this. I'll keep trying.
    • The dequeuing is an issue. Going back and forth a bit will cache them and make it smoother. I'll see if I can make it smoother.
    • The camera thing bugs the hell out of me
    • The editor doesn't disappear off the screen? Any chance of getting a screenshot?
  • edited September 2014 Posts: 2,042

    I also like the undo button on the keyboard, any chance of that in full version?

    EDIT: reproduced both of Zoyt's bugs, shrinking into animation and the keyboard being in use but hidden off screen

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @JakAttak yes, though where to move Find & Replace? I was thinking either have Find & Replace where documentation is, and a long-press brings up documentation. Or the other way around. What is used more: docs or find?

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @JakAttak do you have any steps to reproduce the shrinking into animation?

  • Posts: 2,042

    Docs used more than find more me, idk about others.

    It's not always animation, just the project at the front of list. No steps, I just open a project and when I close it it moves to some new location and I am back at the very first project.

  • Posts: 2,042

    Potential hack to get around tab limitation: savsProjectTab still works.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @JakAttak when you close a project it is supposed to close back to the very first location, e.g.,

    1. Open Flappy
    2. Close Flappy — flappy icon should flip into the the first icon after the "+"

    Is this correct for you? The icon you opened is the same as when you close the editor. You're not having the icon change on you?

    You can use saveProjectTab() however when you re-open the project it will strip all the extra tabs out again. It's a fun hack but it would be too inconvenient to use in a lasting project.

  • @Simeon The entire project that was there before moves to a different location.

  • SimeonSimeon Admin Mod
    edited September 2014 Posts: 5,363

    @SkyTheCoder a completely different location or just one spot further along?

    Edit: to clarify

    • If I have Flappy, Animation, Mesh, Gravity
    • I open "Mesh"
    • Close "Mesh"
    • Order should be: Mesh, Flappy, Animation, Gravity
    • I open and close "Animation"
    • Order should be: Animation, Mesh, Flappy, Gravity
  • edited September 2014 Posts: 1,976

    @Simeon Completely different.

    Edit: odd, after using it for a while it seems to start working as you described, just moving the icon to the top.

  • edited September 2014 Posts: 2,042

    @Simeon, huh hadn't noticed that. Perhaps the tab limitation is not a very important one: you can still type as much as you want in the one tab, multiple tabs simply allow for organization. I don't see that being a big driving force to upgrade vs the awesome functionality left out in scratchpad.

    As Sky says, the project I opened doesn't go the front, but it does correctly move me to the front.

  • Posts: 2,820

    @Simeon I emailed you videos of 2 of the bugs. Sorry I was too lazy to go re-download AirServer (my iPad doesn't have a lightning cable, so I can't use the new iOS 8 + Yosemite feature) and upload it. Anyways, I hope that clarifies what they are with you.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @JakAttak do you think Scratchpad is sufficiently limited?

    @SkyTheCoder I think I know what the bug is now and should be able to fix.

    @Zoyt thanks so much, that was really helpful

  • Posts: 2,042

    @Simeon, I personally think it is sufficiently limited without the tab limit. But that is up to you guys to decide :)

  • edited September 2014 Posts: 2,820

    @JakAttack - Emphasis on Scratchpad, not Scratchnotebook. ;) Anyways, I feel like tabs would be necessary for various example projects (because the point of this is largely to show off Codea, correct?) However, that creates a blurred line between tabs in example projects and scratchpad projects. One could simply copy an example project and then have multiple tabs.

    So here's my 2 ideas of how this could go:
    1. Allow tabs in everything
    2. Flatten the projects when they are copied into a new project

    I think the latter would be better.

  • SimeonSimeon Admin Mod
    edited September 2014 Posts: 5,363

    @Zoyt Scratchpad doesn't have "Copy into new project" — the examples are all mutable. You can edit them and the edits stay. If you want to restore them you can open the settings panel and "Restore Examples". I plan to move this direction for regular Codea (mutable examples).

    The one tab limitation is more to keep the focus on simple, small pieces of code that do interesting things. I wouldn't like to include examples bigger than 300 lines or so.

  • I feel like tabs aren't a feature I would pay $10 for, the main things would be assets, shaders, and exporting to Xcode.

    (I mean, I think tabs for everything would be fine.)

  • Posts: 2,820

    @Simeon - OK. That makes sense.

  • Posts: 2,820

    In that case, I'd suggest making a few more practical examples, such as a calculator or a watered down version of the physics example (to show simple physics mechanics). As always, I'm willing to write some code like that if you're interested.

  • Posts: 2,820

    Sorry for the series of posts in a row, but I though I might as well mention that I just updated to iOS 8.1 beta and it works just as before (as expected). None of the bugs listed above seem to be fixed, though.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @Zoyt @john is making a simple physics demo. Though if you have any good ideas for examples I'm open to including more (planning to submit to app store tomorrow night, so there is a tight schedule). Thanks for the report on 8.1 beta, good to know it's the same.

  • edited September 2014 Posts: 2,042

    Updated to build 2: all the bugs I've seen/read above seem to fixed. I also like the new icon.

    EDIT: laggy scrolling is still there. Other than that all seems good.

  • SimeonSimeon Admin Mod
    edited September 2014 Posts: 5,363

    @JakAttak thanks for the report. Good to know those bugs were fixed.

    Submission to the app store is happening tonight and the planned features/fixes are:

    • Make buttons more responsive when opening projects (show loading indicator)
    • Optimise project loading speed
    • Optimise laggy scrolling (if possible)
    • Add credits section
    • Camera authorisation should only be requested on API use
    • Fix OpenGL rendering on viewer transition in (as in @Zoyt's second video)
    • Add small physics demo and anything else that can make it in
  • SimeonSimeon Admin Mod
    Posts: 5,363

    So I spent a lot of time optimising build 3. Let me know if it's noticeably better for you.

  • Posts: 2,161

    The about page says "rate Codea".

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @Andrew_Stacey and it's the wrong link! Thanks for finding that.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    what i would personnally like for the swipe-to-close:
    - swipe right side to center to close running ptoject.
    - same to go back to project browser.
    Left to right swipe is painful to me: i am right handed, i hold the ipad in my left hand, and use my right hand to tap. right side to left is much easier.
    And not having the same to close the editor feels ... odd? uncomplete?
    Just my personnal feedback.

  • Posts: 2,042

    about codea page is messed up in landscape orientation

  • Posts: 2,161

    Personally, I don't like the swipe and would not like to see it in the main Codea project. I like the ability to keep as much control in my own program as I can.

  • dave1707dave1707 Mod
    Posts: 8,390

    Maybe instead of all the left/right swipes, why not something like the iPad has where you swipe up from the bottom of the screen to bring up a bunch of icons that allow you to do something. Maybe some user definable icons.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @jmv38 The left-to-right swipe is just a standard backwards gesture in iOS. I also tend to swipe with my right hand, but it feels okay to me (most navigation on iOS occurs from the right, so it makes sense to start the back gesture from the left). There is always the button which you can tap with your thumb.

    Agree that the editor should have a similar gesture, it won't make it in to Codea Scratchpad but I think it's possible.

    @Andrew_Stacey I like the swipe, but I also miss supportedOrientations(). So I'm trying to think of a compromise.

    @dave1707 that could be interesting, but it might interfere with the Control Center gesture (it would trigger both at once). I'll keep it in mind.

    @JakAttak thanks for the note on the credits, will fix.

  • edited October 2014 Posts: 1,976

    What about a function you could call such as useSwipeGesture(true/false) that toggled it in the project, for things such as a drawing program where you could drag from the left side of the screen to the right without meaning to close the project?

    Edit: related to JakAttak's comment below, I see nothing about supportedOrientations not working in Scratchpad in the referencel

  • Posts: 2,042

    @Simeon, how come there can't be both the swipe and supportedOrientations?

    Also, on that note of commands not in Scratchpad, any plan to modify the Reference to remove things that aren't supported?

  • edited October 2014 Posts: 2,820

    The scrolling seems marginally better, but not much. Other than that, it looks pretty good. Thanks for adding a clearer loading state when opening projects.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @SkyTheCoder it can't be set via function because you could potentially call the function after the runtime has been presented (this is also an issue with supportedOrientations) . As @Andrew_Stacey says, maybe the swipe gesture is really not very useful and doesn't matter in the full version of Codea?

    @JakAttak sorry, it's in the reference but I forgot to update the localization strings, so it's not showing. Will fix. supportedOrientations() is the only command which is not supported.

    At the moment no swipe + supportedOrientations because I can't find a way to do it without hacks. But I'm still trying — I don't think supportedOrientations is a big deal in Scratchpad. It is valuable in Codea though.

    @Zoyt it's quite smooth on my iPad 3, but yeah there is an occasional stutter on that device.

  • Posts: 2,042

    The orange text in the Parameters window is larger than in normal Codea

  • Posts: 2,042

    It'd be nice to be able to restore example projects individually, rather than all or nothing

  • dave1707dave1707 Mod
    Posts: 8,390

    Anytime I want to alter an example, I copy it to another project. When I'm done with it, I delete it. No need to restore it.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    This is the final Scratchpad build barring any major bugs. Thank you everyone for all your reported issues — and your Codea 2.1 feedback too. There is no way these products would be as good without it!

Sign In or Register to comment.