Reasonable Codea 1.4 suggestions

edited January 2012 in Suggestions Posts: 2,820

Hello TLL,
I don't mean to drive you crazy with suggustions, but I just want tI cast in my vote for things coming in the next few updates.
1. Sprite pack support - At least allow opening .spritepack files that we can make on our computer and eventually create a spritepack creator in Codea.
2. Sockets - This has been a touchy subject, bet here is my opinion: I think it is allowed. Any other doing apps have it. And Apple is on iLuaBox's case and wants then to remove many things like the GUI (I don't know why), but they havent been asked to remove sockets. I noticed that there is just one little chunk of code that you need to include to enable sockets (the socket API is already included in the .ipa file). Apple has only warned you onced about something and about 3 times for iLuaBox. And you won the best app in 2 catagories and you reached staff favorites once, and etc.
3. Project tagging support
4. Project info support like name, description, author, icon...
5. topOfKeyboard() function that returns the top of the keyboard pixel just I case their using a Bluetooth keyboard or split keyboard.
6. Ability to search the help files.
7. Ability to read the clipboard
8. Possibly file IO?
I really don't mean to rush anything, nor drive you guys crazy, but I would really like to see these features rolled out sometime soon. Have idea of how to do something interface wise? I'm always happy to help. (Infact I'd love to help.)
Thanks and no rush at all whatsoever!
- @Zoyt :-D



  • Posts: 80

    Yes, I would like to second more complex file system io to be able to read and write a broader range of data structures.

  • Posts: 2,820

    About file IO, I discovered how to enable it. I'll put it on my iExplorer hacks page as soon as an can.

  • Posts: 2,820

    Tagging files would be nice. I have 56 projects and th most important a at the end :-(

  • Posts: 130

    Good suggestions. But I believe that not all features will be done in 1.4 version.
    By the way, Sprite pack support is the main feature that interests me.

  • Posts: 78

    This is probably too much but I would like to be able to draw dimensions x,y, and z. I feel this could allow us to make more complex games and really open up 3d world.

  • Posts: 2,820

    @Georgian - TLL already has socket support (they just have to insert a few lines of code) and file IO (in fact they purposely got rid of it. I'm fact, I also currently have file IO with a little jack of mine). This seems to be an easy update (If they only add ability to open .spritepack file, not spritepack creators).

  • Posts: 2,820

    @Ldsguy1 - Intresting idea... So basically if we draw farther back in z, it gets smaller? So basically a grid? So we could say something like line(startx,starty,startz,endx,endy,endz)? That sounds fun... I already want ability to open .spritepack files in 1.4

  • BortelsBortels Mod
    Posts: 1,557

    the issues are not just technical - they have to do things Apple will allow. If apple made them pull .codea sharing, do you think they'll allow sockets at this point?

    Having said that - I'd like to see zlib, and encode/decode for png, gif, jpg, and base64. Real spritepack support (which means either grabbing them from the net, or .codea export) would be a reasonable alternative.

  • Posts: 2,820

    @Bortels - Take iLuaBox for example - They had code sharing and such, but that was taken away from them. They've had sickets for a while now... And there have been no requests for it to be pulled. For spritepacks, I atleast want to be able to open and email spritepacks. My opinion that many disagree with.

  • NatNat
    Posts: 143

    I would like support for data files that have their own editor panes but are not Lua source. The program could use an API to open and read data files as needed, so that data doesn't have to all be loaded into the Lua interpreter, as is the case with data stored in Lua tables.

    Maybe there could be special editors for CSV data, images, sounds, ...

  • BortelsBortels Mod
    Posts: 1,557

    I am hoping that Apple will be ok with the downloading of graphics - it shouldn't be against their policy. if I can write a project where I can say "getSpritePack("")" and it grabs and saves the spritepack for that project - that'll be a big step in the right direction. Graphics are big, and encoding them and cutting and pasting them isn't going to scale.

  • The problem with sockets for Codea is that it opens the door to user written code sharing. Apple won't care about sockets until they realize that (which be as soon as somein does it), and then they wiil care, so they'll just pull it. And if they think that someone was trying to slip one by them, then they'll go straight to the penalty phase.

    So the only safe way to add sockets, would be to insure that it can NOT be used for code downloading. And I have no idea how that could be done...

  • NatNat
    Posts: 143

    I'd also like access to the stencil buffer for writing sophisticated masking effects

  • Posts: 2,820

    Theres "I want this" and "I want that". Ill put up a poll for what we want next. That's a good start @Bortels. The worst we can do is encode code in images (haha). I was hoping for the feature to be able top open a .spritepack file.

  • Posts: 2,820

    I do need a rounded rectangle stencil @Nat. You have a point.

  • Posts: 2,161

    Rounded rectangles are easy with meshes:

    function RoundedRectangle(x,y,w,h,s,c)
        if not c then
            c = 0
        if w < 0 then
            x = x + w
            w = -w
        if h < 0 then
            y = y + h
            h = -h
        local rr = mesh()
        local v = {}
        local ce = vec2(x + w/2,y + h/2)
        local n = 4
        local o,dx,dy
        for j = 1,4 do
            dx = 1 - 2*(j%2)
            dy = 1 - 2*(math.floor(j/2)%2)
            o = ce + vec2(dx * (w/2 - s), dy * (h/2 - s))
            if math.floor(c/2^(j-1))%2 == 0 then
        for i = 1,n do
            table.insert(v,o + vec2(dx * s * math.cos((i-1) * math.pi/(2*n)), dy * s * math.sin((i-1) * math.pi/(2*n))))
            table.insert(v,o + vec2(dx * s * math.cos(i * math.pi/(2*n)), dy * s * math.sin(i * math.pi/(2*n))))
            table.insert(v,o + vec2(dx * s,0))
            table.insert(v,o + vec2(dx * s,dy * s))
            table.insert(v,o + vec2(0,dy * s))
            table.insert(v,o + vec2(dx * s,dy * s))
        rr.vertices = v
        rr:addRect(ce.x,ce.y + (h-s)/2,w-2*s,s)
        rr:addRect(ce.x,ce.y - (h-s)/2,w-2*s,s)

    The c parameter controls which corners are rounded. To save time, one could render the result to an image and reuse that instead of redoing the mesh each time, however I've not noticed any performance hit in this as yet.

    (I'd really like a code profiler where I could time bits of the code to see where the slowdowns are and thus where it's worth thinking about optimisations.)

  • Posts: 2,161

    Ah, just realised that this isn't what was requested: a stencil is something like a clip?

    Okay, ignore the previous post ... though maybe one could combine a mesh with an texture from an image to get a generalised clip ... hmm ...

  • Posts: 384

    @Nat, I would love data files separate to lua code. At the moment, encoding data is a pain due to having to wrap it in strings or tables.

  • edited January 2012 Posts: 130

    I want to talk about Sprite pack.
    @Zoyt said: "If they only add ability to open .spritepack file, not spritepack creators" - And if they will not?
    I have a great ideea, if they will not add ability to open .spritepack file It is a tragedy.
    We have another solution: Add ability to open/import images from Camera Roll.
    So, here at Sprite Picker, add a button "Load from Camera Roll" or add a button "Create new SpritePack".
    If the button "Create new SpritePack" is pressed, it will open an SpritePack creator, here will be few forms:
    Icon, Name and ability to add images from Camera Roll and then save it.
    I have over 100 apps in my iPad and over 70% of apps, not the games, use this function: Load images from Camera Roll.
    So, do not tell me, Codea can't do that.

  • Posts: 146

    I have somewhat simpler ideas for 1.4, maybe they seem reasonable enough to add.

    • I would like to have a way to get at the current transformation matrix, including a way to invert it and to transform a vector using it or its inverse. I think a mat2 package would be nice for that.
    • clipping would be great. Nothing fancy, a simple clipping rectangle would do.
    • a simple way to copy code files from one project to another.
  • SimeonSimeon Admin Mod
    Posts: 5,641


    1. We plan to add a way to get the current transformation matrix, and to apply arbitrary matrices.
    2. That's actually already in there, see clip(x, y, w, h), you can use clip() to clear the clipping rect
    3. Cross-project code files are also something we're interested in providing
  • Posts: 146

    Brilliant :) I did not find clip() in the docs, but glad it's there. That's gonna help a lot.

  • Posts: 2,161

    I was right. You can use a mesh as a general clip. Render the stuff to an image. Then define the mrsh to cover the region you want to see, and it clips the image to the mesh.

    img = image(100,100)
        for i = 1,100 do
            for j = 1,100 do
        stroke(0, 255, 27, 255)
        stroke(255, 0, 251, 255)
        stroke(255, 242, 0, 255)
        tex = mesh()
        tex.texture = img
        local v = {}
        local t = {}
        local s = 10
        for i = 1,360,s do
            table.insert(v,vec2(50*math.cos(math.rad(i)), 50 *math.sin(math.rad(i))))
            table.insert(v,vec2(50*math.cos(math.rad(i-s)), 50 *math.sin(math.rad(i-s))))
            table.insert(t,vec2(.5 + .5*math.cos(math.rad(i)), .5 - .5*math.sin(math.rad(i))))
            table.insert(t,vec2(.5 + .5*math.cos(math.rad(i-s)), .5 - .5 *math.sin(math.rad(i-s))))
        tex.vertices = v
        tex.texCoords = t

    That lot goes in setup. Then draw the mesh in the draw routine.

  • Posts: 2,820

    Thanks @Andrew. I'll try it when I get a chance. Whith my Codea style UI, the switches have to be masked by tinting an overlay to the background color, masking the sliding part to where it should be, and then drawing it. It's a little slow. Atleast with this, I can get rid of the mask. Thanks! And about the other suggustions, these are so many and nobody knows what to do with spritepacks. Feel free to post your mockup. That's what i'm doing. Especially for spritepacks.

  • edited February 2012 Posts: 2,820

    Project description and icon are coming in 1.3.1 (I had te read Simeon's comments on the beta discussion. Too bad I'm not one :-(( )

  • BortelsBortels Mod
    Posts: 1,557

    Or - maybe not. There have been plenty of things in beta (sockets!) that didn't make it to release. It depends very much on how well they work and if they introduce other issues, and in the end if Apple approves.

    I would also suggest, to be blunt, if Simeon had wanted the beta discussion posted in public, he would have posted it in public. I know he's expressed a desire to keep beta discussion separate so that people won't be disappointed or confused by features that don't make the cut, or that change between beta and release. If you must repost, at least make a "beta 1.3 unconfirmed rumors" thread or such, please?

  • BortelsBortels Mod
    Posts: 1,557

    Heh - and, having said that, Simeon posted that information in the upcoming releases page. Carry on. :-)

  • Posts: 2,820

    Alright. Sorry. Ya, I've seen the sockets alright. I've gone in to Codea with iExplorer a lot (mabey a few too many times).

  • Posts: 2,820

    I know... He didn't post about the icons yet though.

  • BortelsBortels Mod
    Posts: 1,557

    Well - they're not in the beta... yet! But I'm excited - it looks like the intent is to give us arbitrary save/load of images, and "real" file io, properly sandboxed to the project directories, with a global share area. That would be truly cool. We'll see how it goes...

    Presumably - and this is total speculation - you could make a "spritepack loader", where you copy/pasted in base-64 encoded graphics, and had a project that just saved them to global storage as "Zoyt:UpArrow" and "Zoyt:DownArrow" and the like, and BOOM - you just added a spritepack. Dunno if it would be a spritepack, but if you can access it the same way, who cares? (It would be nicer to be able to just import, but meh)

  • Posts: 2,820

    "I would also suggest, to be blunt, if Simeon had wanted the beta discussion posted in public, he would have posted it in public." Haha. I'd be a happy to make that description and sprite setter. Not too hard, can it?

  • BortelsBortels Mod
    Posts: 1,557

    Dunno - have you written code to write a .png file?

  • Posts: 2,820

    No... I'm not that good a coder. Just thinking that we could use spritely... If only we could read the clipboard :(

  • Posts: 2,820

    I want sockets :-D

  • BortelsBortels Mod
    Posts: 1,557

    if this works out, spritely can simply save as a PNG and you can use it as a sprite.

    And yes - I want sockets too. or email, even. I could live with email in/out.

    I want to write multiplayer internet games. Can't do it if I can't communicate.

  • Posts: 2,820

    Agreed. Absolutely.

  • edited February 2012 Posts: 1

    Well since we're talking about 1.4 suggestions, here are mine:

    1. Ability to search in the editor. Currently if I want to rename a function or global variable, I have to copy and paste the window contents into another app, and search there to find all the references that need changing! Fail!

    2. Could you make Codea share its project files in iTunes? A number of apps have this feature where if you link the iPad to your PC (sorry, I mean Mac :) ) you can drag files to and from the app. This could be a way of working around Apple's restrictions on downloading code while still making it possible to share projects relatively easily.

    Just my 2c worth.

  • Posts: 2,820

    @cdbrown - Haha. No you don't. You can go back and change it. To put these suggestions in wich I agree with, go to my poll I just created. It's at the top of the list of discussions.

  • SimeonSimeon Admin Mod
    Posts: 5,641


    1. I have a fairly good idea on how to do search. It's definitely up there, priority-wise. I generally find that anything that annoys me while I'm using Codea gets fixed pretty fast. And this is something that annoys me.

    2. They actually rejected Codea 1.0 for having iTunes File Sharing enabled — and you couldn't even upload code, just download it from Codea to your PC. I'm going to enable this again in one of the future updates but I would expect it to trigger a rejection-cycle or maybe a lengthy review process. I know that the GLSL studio dev was granted this feature on appeal, so there's a remote chance we might be allowed to as well, it will just take a long time waiting for Apple to respond.

  • I have around 200 codea projects (mainly copied from forums etc.). I was working on something last night and forget what I called it. I'd really appreciate something to help find things. Either project sub project organization, date modified sort order, or a list project by search. I was learning mesh. Searching for mesh would find my project plus @John's recent sample that I'm referencing.

  • Posts: 2,820

    Wow. We could make a competition out of how many projects you have. You know that game finger runner? Those skills come in handy here.

  • SimeonSimeon Admin Mod
    Posts: 5,641

    @Ipda41001 this will be addressed as soon as possible.

  • edited February 2012 Posts: 622

    Thx ... I did find it .. It was Mmesh not Pmesh :)

    Edit: did some clean up only 175 things I want to keep. On noz, Imma a Codea hoarder.

  • Posts: 2,820

    How about just sprite packs and reading the clipboard and tagging in 1.5.

  • BortelsBortels Mod
    Posts: 1,557

    "I forgot what I called it" - lol. I'm SO there.

    And I have a like 7 that start with "Sp" so they all look the same.

    But - Icons and descriptions are coming. That may help.

  • edited February 2012 Posts: 2,820

    @Bortels - I just think its funny what you said about beta discussion. Simeon hadn't posted about the icing yet :-))

  • edited February 2012 Posts: 273
      But - Icons and descriptions are coming. That may help.

    Yes. It may help with finding projects but not with the increasingly timely and tiresome s-s-s-s-s-c-c-c-c-c-c-c-c-c-r-r-r-r-r-r-r-o-o-o-o-o-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l-l back and forth between them.

    I fear that by the time the user has assembled a reasonable amount of code in Codea's browser (i.e. morphed from curious disciple to full blown apostle) the once playful and inviting project selection interface has turned very user unfriendly.

    IMHO :)

  • Posts: 2,820

    Reading the clipboard would be REALLY nice. The more I think about it, the more ideas I get... For instance importing sprites from the clipboard with Spritely...

  • Posts: 146

    I have another one, pobably really tiny but with a big impact ;)

    Could Codea be made to check wether a file in the internal storage (disk) has changed, whenever, say, it is started or resumed (switched to) or the device is turned on when codea is active? I know it does so when I leave a project and open it again, but checking on a few more opportunities would help with some things, like doing large edits or search and replace on an external computer.

  • SimeonSimeon Admin Mod
    Posts: 5,641

    @gunnar_z that's a very good suggestion and would assist in getting Codea to play nice with external editors.

Sign In or Register to comment.