Howdy, Stranger!

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

Codea 1.5 (Beta 11)

SimeonSimeon Admin Mod
edited January 2013 in Beta Posts: 5,362

Starting a new thread for this beta.

This beta initiates some work on the Shader Lab — my intention has always been for uniform variables in the Shader Lab to be interactive. In this build you can tap float/vec2/vec3/vec4 uniforms to adjust their values in real-time. You can try this on the Ripple example shader (on the time and freq variables in the Fragment program).

The idea is that these values will end up saved with the shader as "sample" values. The plan is also to allow sampler2D uniforms to bring up the image picker so textures (or CAMERA input) can be selected from the Shader Lab. Vec4 types should also get the colour picker as an option.

Let me know if you have any other ideas in this area.

.@Jmv38 this should fix the cursor positioning bug on iOS 5.x — please let me know

.@tnlogy this should fix the "+" character wrapping issue you reproduced in the previous thread

.@mpilgrem this fixes some of the documentation bugs you mentioned earlier (duplicate backingMode and so on).

Edit: The build is still uploading. I have a terribly slow Internet connection.

Comments

  • Posts: 196

    Nice :)
    Regarding the shader uniforms, so far it seems to work, but not when multiple variables are set in the same line like:
    uniform lowp vec2 a, b;
    None are selectable that way

  • Jmv38Jmv38 Mod
    edited January 2013 Posts: 3,295

    Concerning shader resources: Shaderrific on the app store is great: the free version comes with 22 great shaders to copy/ paste for us. Much better than GLSL studio - and free!
    @Simeon the cursor pb seems to be solved. Thanks sooooo much!

  • Posts: 489

    The stability of the Shader Lab Editor seems to be good in beta 1.5(11).

    I wrote the following code to understand how Lua types might map/cast to GLSL ES types:

    Vertex shader:

    //
    // Vertex shader: Uniform Explorer
    //
    
    uniform mat4 modelViewProjection;
    
    attribute vec4 position;
    attribute vec2 texCoord;
    
    varying highp vec2 vTexCoord;
    
    void main() {
        vTexCoord = vec2(texCoord.x, 1.0 - texCoord.y);
        gl_Position = modelViewProjection * position;
    }
    

    Fragment shader:

    //
    // Fragment shader: Uniform Explorer
    //
    
    precision highp float;
    uniform lowp sampler2D texture;
    uniform float uFloat;
    uniform int uInt;
    uniform bool uBool;
    uniform vec2 uVec2;
    uniform vec4 uVec4;
    uniform ivec2 uIvec2;
    
    varying lowp vec4 vColor;
    varying highp vec2 vTexCoord;
    
    void main() {
        lowp vec4 col = texture2D( texture, vTexCoord );
        col = col * uFloat * float(uInt + 1) * float(uIvec2.x + 1)
            * uVec2.x;
        if (uBool)
            col = uVec4;
        gl_FragColor = col;
    }
    

    Lua:

    --
    -- Uniform Explorer
    --
    
    function setup()
        local s = 200
        m = mesh()
        m.vertices = {vec2(-s, -s), vec2(s, -s), vec2(0, s)}
        -- UV origin in top left corner of texture
        m.texCoords = {vec2(0, 1), vec2(1, 1), vec2(0.5, 0)}
        m.texture = readImage("Small World:Court")
        m:setColors(255, 255, 255)
        m.shader = shader("Documents:UniformExplorer")
        parameter.number("uFloat", 0, 1, 1)
        parameter.number("uInt", -2, 3, 0)
        parameter.boolean("uBool", true)
        parameter.number("uNumber", -2, 2, 0)
        parameter.number("uVec2x", 0, 1, 1)
        parameter.color("uVec4", color(255, 0, 0))
        parameter.number("uIvec2x", -2, 3, 0)
    end
    
    function draw()
        background(0)
        translate(WIDTH / 2, HEIGHT / 2)
        m.shader.uFloat = uFloat
        m.shader.uInt = uInt -- math.modf(uInt)?
        -- m.shader.uBool = uBool does not work
        m.shader.uBool = uNumber -- math.modf(uNumber)?
        m.shader.uVec2 = vec2(uVec2x, 0)
        m.shader.uVec4 = uVec4
        -- The following does not work
        m.shader.uIvec2 = vec2(uIvec2x, 0)
        m:draw()
    end
    

    I was expecting Lua boolean types to map to ES bool, but it looks like math.modf(Lua number) == 0 maps to false and other Lua number values map to true.

    It looks like math.modf(Lua number) maps to ES int.

    It looks like ES ivec2 (etc) are not wired up.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    BUG SETCONTEXT this is a rather special case, but for once it shows up in a short program, here it is. On my ipad the blue square is leaking to the top, but it stops after some time, differently for bottom bar and top bar. And the red squre does not leak... Maybe solving this will solve all the other weird cases?
    The bug does not show if i write img in img2.



    --# Main -- test sprite displayMode(FULLSCREEN) -- Use this function to perform your initial setup function setup() img = image(WIDTH,HEIGHT) img2 = image(WIDTH,HEIGHT) setContext(img) background(0, 0, 0, 0) fill(0, 12, 255, 0) strokeWidth(7) stroke(0, 12, 255, 255) rect(300,300,100,100) stroke(255, 0, 0, 255) rect(0,0,WIDTH,HEIGHT) setContext() spriteMode(CORNER) setContext(img2) background(0, 0, 0, 0) setContext() end -- This function gets called once every frame function draw() background(40, 40, 50) strokeWidth(5) sprite(img,0,0) setContext(img) sprite(img,0,0) setContext() end
  • Jmv38Jmv38 Mod
    edited January 2013 Posts: 3,295

    REQUEST i want to support @tnlogy request to have shaders in 'normal' tabs. One of the great values of Codea is the pleasure of quickly testing other's programs. This is possible via the single copy/paste operation as implemented today. If shaders have to be copied one by one, in parts, then this value is gone. I don't even try present programs when they are posted as separate tabs, because it is too much effort for unsure result (they don't always work once copied, or were not worth it). It would be quite simple for you to implements shaders as you did for Class() tabs. For instance (might not be the correct syntax):

    shadow = Shader()
    Shader:vertexShader()
    end
    Shader:fragmentShader()
    end
    

    we could still developp the shader in the shader lab,
    And once we are happy with it copy it to a tab if we want to share the project.
    The program when run would first check if there are shaders defined in it and if so create them dynamically (and remove them at the end of execution, restoring the original shader with this name if any).
    The difficulty for you would be to have 2 tab types: one with LUA and the other with GLSL language. And you have to check syntax and colors accordingly.
    But i am fairly sure most users would prefer this structure, for many reasons (sharing, saving, Managing versions, etc..)

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@mpilgrem At the moment only sampler2d, bool, int, float, vec2, vec3, vec4, mat4 are hooked up (also float, int and bool arrays).

    We'll need to add ivec and Lua boolean type support.

    .@Jmv38 your setContext bug is not showing up here — I'll keep testing. Though it looks like you are rendering an image into itself (setContext(img) -> sprite(img)). I'm not sure whether that is going to generate correct results.

    Regarding shaders in tabs. It's a good idea, a big change, and I'll need to think about whether it's possible. Probably unlikely for 1.5.

    At the moment it's possible to put your shaders into Codea code by doing:

    myShader.vertexProgram = "... source code ..."
    myShader.fragmentProgram = "... source code ..."
    

    Not a great solution, but one that works at the moment.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Thanks for your concern @Simeon. I just posted a setContext bug example without self writing into an image, see the forum. For the shaders: if it is possible to include them into the program with the two lines above, and just copy/paste the code from the shader lab, without additionnal editing, then that's good enough for me: the target 'easy sharing for users' is hit. Maybe keep the precious ressource of your time for more critical tasks. Like keeping Codea compatible with former versions of ios, let's say ios5.1 ;-)

  • edited January 2013 Posts: 489

    Hello @Simeon. Why do you hook up GLSL ES bool (which, as I understand it, is a pure boolean: true or false only) to Lua number rather than to Lua boolean (which, as I understand it, is also a pure boolean)?

    (Update) I wonder if Lua values of type other than Lua boolean should be first cast to Lua boolean (if they can) before being passed to a uniform that is of GLSL ES type bool?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    BUG COROUTINE the following code works fine, except when i try to print something with the coroutine it kills codea. All web examples use print in coroutine, so it should work?



    --# Main -- test coroutine simple co = coroutine.create( function() for i = 1, 10 do value = i -- print(value) -- uncomment this line to kill codea coroutine.yield() end end) function setup() print("Hello World!") value = 0 coroutine.resume(co) end -- This function gets called once every frame function draw() background(40, 40, 50) text(tostring(value),WIDTH/2,HEIGHT/2) end function touched(touch) if touch.state == BEGAN then coroutine.resume(co) end end
  • edited January 2013 Posts: 489

    I find the same as @Jmv38: print() in coroutine code causes misbehaviour. For example, this will not run twice or three times (locking up the Editor with a glowing run button):

    --
    -- Coroutine Tester
    --
    
    function code()
        print("Bug!")
        myGlobal = "Code called!"
    end
    
    function setup()
        myCoroutine = coroutine.create(code)
        coroutine.resume(myCoroutine)
        print(myGlobal)
    end
    
    function draw() background(0) end
    
  • JohnJohn Admin Mod
    Posts: 616

    .@mpilgrem

    I was under the impression that Lua didn't have a native boolean type, I'll map it to a boolean instead with appropriate casting.

  • Posts: 489

    I think that blendMode() returns 0 0 0 0, irrespective of the blend mode that has been set, in error.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Thanks @mpilgrem. I've fixed the blendMode return issue.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    bug coroutine it seems coroutine in not compatible with setContext(). Uncomment the setContext section below to kill codea.

    increment5 = coroutine.wrap( function(img,out,budget)
        local r0,g0,b0,a0
        local r,g,b,a
        local c,count =0,0
        local t0 = 0
        local clock = os.clock
        while true do
        
        for x = 2, img.width-1 do
            for y = 2, img.height-1 do
                r0,g0,b0,a0 = 0,0,0,0
                for p=1,3 do for q=1,3 do
                    r,g,b,a = img:get(x+p-2,y+q-2)
                    r0,g0,b0,a0 = r0+r ,g0+g ,b0+b ,a0+a
                end end
                r0,g0,b0,a0 = r0/9, g0/9, b0/9, a0/9
                out:set(x,y,r0,g0,b0,a0)
            end
            if t0 < clock() then 
                coroutine.yield() 
                t0 = clock()+1/60 * budget
            end
            value3 = x
        end
        --[[
        setContext(img)
            spriteMode(CORNER)
            sprite(out)
        setContext()
        --]]
        count = count + 1
        value4 = count
        end
    end)
    
    
    function setup()
        print("Hello World!")
        value = 0
        img5 = image(100,76)
        setContext(img5)
            background(0, 9, 255, 255)
            fill(255, 0, 0, 255)
            rect(20,20,20,20)
        setContext()
        out5 = image(100,76)
    end
    
    -- This function gets called once every frame
    function draw()
        background(40, 40, 50)
        fontSize(50)
        local x=WIDTH/2
        text("increment3 : "..tostring(value3),x,HEIGHT-200)
        text("increment4 : "..tostring(value4),x,HEIGHT-250)
        sprite(img5,x,HEIGHT-400)
        sprite(out5,x-200,HEIGHT-400)
        increment5(img5,out5,0.1) 
    end
    
  • Jmv38Jmv38 Mod
    Posts: 3,295

    BUG COROUTINE defining an image inside a coroutine kills codea

        local out = image(img.width,img.height)
    
  • Posts: 489

    Hello @Simeon - three thoughts on the blendMode() addition to the beta 1.5 API:

    (1) is it necessary to start all of the new global variables for modes with BLEND_? I do not think that there would be much damage done (and some benefit: for example, in the utility of autocomplete in the Editor) if the prefix was removed. (Especially as the values of globals ZERO and ONE would, in fact, be 0 and 1.) I do not think that there is a need to replicate the GL_ of the underlying OpenGL in order to create an effective 'namespace'.

    (2) I noticed that you omitted the four CONSTANT modes from the global variables. I was wondering whether, for a complete implementation, they could be included and, perhaps, tint() could have a role in setting/getting the glBlendColor used by the modes (behind the scenes). If not tint(), then (new) blendColor() could set/get that colour.

    (3) I have not yet checked, but does pushStyle() preserve the blendMode()?

  • Posts: 502

    bug: cannot import images from photo library in landscape mode. the import window is only a couple of pixels high. but work fine if I turn the ipad to portrait mode.

  • Posts: 489

    An extended version of the 'Blend Modes' example project:

    --
    -- Blend Modes Explorer
    --
    
    supportedOrientations(LANDSCAPE_ANY)
    function setup()
        print("This demonstrates blending modes. Blend modes determine "..
        "how drawing operations blend together on-screen.")
        mode = {
        BLEND_ZERO, BLEND_ONE,
        BLEND_SRC_COLOR, BLEND_ONE_MINUS_SRC_COLOR,
        BLEND_DST_COLOR, BLEND_ONE_MINUS_DST_COLOR,  
        BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA,
        BLEND_DST_ALPHA, BLEND_ONE_MINUS_DST_ALPHA,
        BLEND_SRC_ALPHA_SATURATE}    
        modeName = {
        "ZERO", "ONE",
        "SRC_COLOR", "ONE_MINUS_SRC_COLOR",
        "DST_COLOR", "ONE_MINUS_DST_COLOR",  
        "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA",
        "DST_ALPHA", "ONE_MINUS_DST_ALPHA",
        "SRC_ALPHA_SATURATE"}
        local n = #mode
        parameter.integer("srcFactor", 1, n, 2)
        parameter.integer("srcAlpha", 1, n, 2)
        parameter.integer("destFactor", 1, n, 8)
        parameter.integer("destAlpha", 1, n, 8)
        for i = 1, n do
            print("BLEND_"..modeName[i].." == 0x"..
                string.format("%04x", mode[i]))
        end
        textAlign(CENTER)
        strokeWidth(5)
        stroke(206, 179, 179)
        parameter.color("col", color(207, 52, 13))
    end
    
    function drawEllipsePair(x, y, radius)
        ellipse(x - radius / 2, y, radius * 2)
        ellipse(x + radius / 2, y, radius * 2)
    end
    
    function draw()
        background(69, 80, 96)
        msg = "rgb = "..modeName[srcFactor].." * Srgb + "..
            modeName[destFactor].." * Drgb".."\na = "..modeName[srcAlpha]..
            " * Sa + "..modeName[destAlpha].." * Da"
        fill(255)
        blendMode(NORMAL)
        local fs = math.min(28, textSize(msg) / WIDTH * fontSize())
        fontSize(fs)
        text(msg, WIDTH / 2, HEIGHT / 2 + 250)
        fontSize(32)
        text("NORMAL", WIDTH * 0.2, 40)
        text("ADDITIVE", WIDTH * 0.5, 40)
        text("MULTIPLY", WIDTH * 0.8, 40)
        blendMode(mode[srcFactor], mode[destFactor],
            mode[srcAlpha], mode[destAlpha])
        fill(col)
        drawEllipsePair(WIDTH / 2, HEIGHT / 2, 100)
        blendMode(NORMAL)
        drawEllipsePair(WIDTH * 0.2, HEIGHT / 2 - 250, 60)
        blendMode(ADDITIVE)
        drawEllipsePair(WIDTH * 0.5, HEIGHT / 2 - 250, 60)
        blendMode(MULTIPLY)
        drawEllipsePair(WIDTH * 0.8, HEIGHT / 2 - 250, 60)   
    end
    
  • edited January 2013 Posts: 489

    Hello @Simeon - some thoughts on the tween() addition to the API, noting that the in-app reference is not yet complete:

    (1) the fields of tween.easing take the form (eg) inQuad but the in-app reference indicates that they take the form tween.quadIn ... and omits the .easing (tween.easing.inQuad).

    (2) the in-app reference indicates the existence of tween(time, subject, target, easing, callback, ...) but does not explain the significance of the final ... (update) - although, from the sample code, it can be deduced that it is to provide optional arguments to the callback function. Unlike the other arguments, callback is not elaborated on (update) (including its use of optional arguments).

    (3) the table tween has the following fields referencing functions that are not documented in the in-app reference: start, path, sequence, update, hasExpired, loop.

  • Posts: 2,161

    .@mpilgrem Nice extension - shall use that for further investigations. I was thinking that blendmode could be very useful in erasing stuff and came up with the following for the rectangle with a hole:

    function setup()
        img = image(300,300)
        setContext(img)
        background(34, 34, 34, 255)
        blendMode(NORMAL)
        rectMode(CENTER)
        fill(255, 0, 0, 255)
        rect(150,150,300,300)
        blendMode(
            BLEND_ZERO,BLEND_ONE_MINUS_SRC_ALPHA
            )
        fill(0, 0, 0, 255)
        ellipse(150,150,200,200)
        setContext()
        blendMode(NORMAL)
    end
    
    function draw()
        background(34, 34, 34, 255)
        stroke(255, 255, 255, 255)
        strokeWidth(10)
        line(0,0,WIDTH,HEIGHT)
        spriteMode(CENTER)
        sprite(img,WIDTH/2,HEIGHT/2)
    end
    
  • Posts: 2,161

    Here's my exploration (with a few bits "borrowed" from @mpilgrem's code!). The output is what I've just uploaded to Twitter (somehow I can never get those pictures to embed here). What it does is draw two squares one on top of the other with a specific blend mode. To avoid interaction with the background, it does this in a separate blank image. That image is then drawn in normal blending mode onto the background. The squares are gradients: block colour but with gradient alpha, and in different directions. Then all the different combinations (for the 2-element blendMode function) are displayed in a grid. Took me a while to spot NORMAL amongst them!

    --
    -- Blend Modes Explorer
    --
    
    supportedOrientations(LANDSCAPE_ANY)
    function setup()
        print("This demonstrates blending modes. Blend modes determine "..
        "how drawing operations blend together on-screen.")
        mode = {
        BLEND_ZERO, BLEND_ONE,
        BLEND_SRC_COLOR, BLEND_ONE_MINUS_SRC_COLOR,
        BLEND_DST_COLOR, BLEND_ONE_MINUS_DST_COLOR,  
        BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA,
        BLEND_DST_ALPHA, BLEND_ONE_MINUS_DST_ALPHA,
        BLEND_SRC_ALPHA_SATURATE}    
        modeName = {
        "ZERO", "ONE",
        "SRC_COLOR", "ONE_MINUS_SRC_COLOR",
        "DST_COLOR", "ONE_MINUS_DST_COLOR",  
        "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA",
        "DST_ALPHA", "ONE_MINUS_DST_ALPHA",
        "SRC_ALPHA_SATURATE"}
        local n = #mode
        local w = math.floor(math.min(WIDTH,HEIGHT)/n)
        local src = mesh()
        src:addRect(w/2,w/2,w,w)
        src.colors = {
            color(255, 0, 0, 0),
            color(255, 0, 0, 255),
            color(255, 0, 0, 255),
            color(255, 0, 0, 0),
            color(255, 0, 0, 255),
            color(255, 0, 0, 0)
        }
        local dest = mesh()
        dest:addRect(w/2,w/2,w,w)
        dest.colors = {
            color(0, 0, 255, 255),
            color(0, 0, 255, 255),
            color(0, 0, 255, 0),
            color(0, 0, 255, 255),
            color(0, 0, 255, 0),
            color(0, 0, 255, 0),
        }
        im = image(WIDTH,HEIGHT)
        spriteMode(CORNER)
        local imw = image(w,w)
        for i = 1, n do
            print(modeName[n+1-i])
            for j = 1,n do
                setContext(imw)
                dest:draw()
                blendMode(mode[i],mode[j])
                src:draw()
                setContext()
                blendMode(NORMAL)
                setContext(im)
                resetMatrix()
                sprite(imw,(i-1)*w,(j-1)*w)
                setContext()
            end
        end
    end
    
    function draw()
        background(255, 255, 255, 255)
        sprite(im,0,0)
    end
    
  • JohnJohn Admin Mod
    Posts: 616

    .@mpilgrim @Jmv38

    The coroutine bug has been fixed.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    .@John great job! Thanks.

  • Posts: 489

    The in-app reference says that tween() returns an 'int', but it returns a table.

    Below is some short code to explore that and the easing functions:

    --
    -- Tween Explorer
    --
    
    supportedOrientations(LANDSCAPE_ANY)
    function setup()
        easingType = {
            "Quad", "Cubic", "Quart", "Quint",
            "Expo", "Sine",
            "Back", "Bounce", "Elastic"}
        inOutType = {"in", "out", "inOut", "outIn"}
        duration = 3
        dim = math.min(WIDTH, HEIGHT)
        offset = dim / 4
        margin = dim / 20
        width = margin / 10
        dim = dim - offset * 2 - margin - width
        easingFunction = 1
        inOutFunction = 1
        parameter.integer("easingFunction", 1, #easingType, 1, reset)
        parameter.watch("easingType[easingFunction]")
        parameter.integer("inOutFunction", 1, #inOutType, 1, reset)
        parameter.watch("inOutType[inOutFunction]")
        reset()
        elaborate("tweenId", tweenId)
        local col = color(255, 255, 0)
        fill(col)
        stroke(col.r * 0.5, col.g * 0.5, col.b * 0.5, 255)
        rectMode(CORNER)
        spriteMode(CORNER)
        ellipseMode(CORNER)
        noSmooth()
        fontSize(32)
    end
    
    function elaborate(k, v)
        local typeV = type(v)
        if typeV == "table" then
            print(k.." is a table")
            for k1, v1 in pairs(v) do
                elaborate(k.."."..k1, v1)
            end
        elseif typeV == "function" then
            print(k.." is a function")
        else
            print(k.." = "..v)
        end
    end
    
    function draw()
        background(64)
        text(easingString..": touch Viewer to rerun.",
            WIDTH / 2, HEIGHT - 50)
        strokeWidth(5)
        line(offset, offset + margin,
            offset + margin + dim + width, offset + margin)
        line(offset + margin, offset,
            offset + margin, offset + margin + dim + width)
        noStroke()
        rect(offset, subjectY.y + offset + margin, margin, width)
        rect(subjectX.x + offset + margin, offset, width, margin)
        setContext(img)
        ellipse(subjectX.x, subjectY.y + offset + margin, width)
        setContext()
        sprite(img, offset + margin, 1)
    end
    
    function touched(touch)
        if touch.state == BEGAN then reset() end
    end
    
    function reset()
        easingString = inOutType[inOutFunction]..easingType[easingFunction]
        img = image(dim + width, dim + width + offset * 2)
        subjectX = {x = 1}
        local targetX = {x = dim}
        tween(duration, subjectX, targetX)
        subjectY = {y = 1}
        local targetY = {y = dim}
        tweenId = tween(duration, subjectY, targetY, easingString,
            nil, "arg1", "arg2")
    end
    
  • edited January 2013 Posts: 489

    Running tween() creates (update) global variables easing and loop that reference functions. Is that the intention? For example:

    function setup()
        print(easing) -- Output: nil
        tween(1, {x=0}, {x=1})
        print(easing) -- Output: function 0x????????
    end
    
    function draw() background(0) end
    
  • Posts: 1,255

    I'm seeing some odd behavior in the editor when hitting the backspace button. Not always, but with regularity, there's a long delay between using the backspace button and text actually going away. This is particularly true when an area if text is selected and I hit the backspace to delete.

  • edited January 2013 Posts: 489

    It is not yet in the in-app reference, but I believe easing functions for tween() have this form (at least, for the first four arguments):

    -- t is the current time
    -- d is the duration of the animation
    -- b is the initial animated value
    -- c is the change in the animated value by the end of the animation
    function myEasing(t, b, c, d)
        t = t / d
        return b + c * math.pow(math.sin(t * math.pi * 2.5), 2)
    end
    
  • Posts: 489

    Hello @Simeon. Like @Mark, I am also experiencing Editor misbehaviour. Try this:

    1. Create a new project.

    2. Double tap the Viewer to select the word function.

    3. Press the backspace key.

    The deletion of the text selected this way is not rendered until the cursor is moved to a new line.

  • I still have these problems:

    Cannot move to or select the very last character of an editor window with the special keys.

    Cannot get saveProjectTab() to work. The only reference I found about this is a comment by toadkick back in November where it worked for him. Here's the link, since the vanilla forums are inherently unsearchable and Google doesn't see the beta threads:

    http://twolivesleft.com/Codea/Talk/discussion/comment/15423#Comment_15423

    I've also got a strange effect with the GraphicsStyle example. No code is being run at all.

  • SimeonSimeon Admin Mod
    edited January 2013 Posts: 5,362

    Thanks @mpilgrem and @Codeslinger.

    .@mpilgrem

    I can reproduce that. Looking into it.

    .@Codeslinger

    • I've fixed the move/select so that it works up to the last character in the next build.

    • Looking into saveProjectTab() — it seems to work for me, try the following in a test project:

    function setup()
        saveProjectTab( "TestTab", "-- Blah blah blah")
    end
    

    This creates a tab named "TestTab" in the current project with the contents when leaving the viewer.

    • I am unable to reproduce Graphics Style example not rendering on iOS 5 or 6. If you have any further detail on this it would be appreciated.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@Codeslinger it seems that the saveProjectTab issue occurs when you attempt to explicitly save into the current project by name.

    So if my current project is named "Foo", then saveProjectTab("Foo:MyTab", "Contents...") doesn't appear to work. saveProjectTab("Some Other Project:MyTab", "Contents...") does work, however (provided "Some Other Project" is not an example). And saveProjectTab("MyTab", "Contents...") also works for saving into the current project.

    I'll fix this issue.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@Mark @mpilgrem thank you for reporting the editor bugs, they should be fixed in the next build.

Sign In or Register to comment.