Reasonable Codea 1.4 suggestions

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.

@gunnar_z

  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

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

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
            img:set(
                i,
                j,
                color(math.floor(i*2.55),0,math.floor(j*2.55),255)
                )
        end
    end
    setContext(img)
    strokeWidth(5)
    stroke(0, 255, 27, 255)
    noFill()
    line(1,1,100,100)
    line(1,100,100,1)
    stroke(255, 0, 251, 255)
    line(50,1,50,100)
    stroke(255, 242, 0, 255)
    line(1,50,50,1)
    line(50,1,100,50)
    rect(30,30,40,40)
    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(v,vec2(0,0))
        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))))
        table.insert(t,vec2(0.5,0.5))
    end
    
    tex.vertices = v
    tex.texCoords = t

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

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.

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 :-(( )

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?

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

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).

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

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)

“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?

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

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

I want sockets :smiley:

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.

Agreed. Absolutely.

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 :slight_smile: ) 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.

@cdbrown

  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.

@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.