Howdy, Stranger!

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

Codea 2.2 Beta

13»

Comments

  • dave1707dave1707 Mod
    Posts: 8,555

    @ Simeon I get the same thing as @JakAttak. If I go back I'm signed out. if I go forward, I'm signed back in.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    I've tried to resolve the forum issue in build 32. @JakAttak also all the Xcode stuff + Game Center addon should work correctly now.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    Apple TestFlight seems a bit funny at the moment, let me know if you can't see / are unable to upgrade to build 32.

  • dave1707dave1707 Mod
    Posts: 8,555

    @Simeon I get the message "The request app is not available or doesn't exist. Try again" .

  • dave1707dave1707 Mod
    Posts: 8,555

    @Simeon I was able to load the second update you sent. I'm still getting logged out when I use the back arrow in the Codea forum. If I load a lot of discussions and do the back arrow, it looks like it alternates being logged out, then logged in, logged out, etc.

  • dave1707dave1707 Mod
    Posts: 8,555

    @Simeon Played with the back arrow some more. I loaded about 6 discussions and when I'm logged out, I'm at the top of the discussion page but when I'm logged in, I'm at the bottom of a discussion. It seems to depend on if the previous page was in a discussion or at the forum page.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    Thanks @dave1707, the reason for the forum log out is because the web view caches the logged out screen, and when you hit back it sometimes just shows the logged out screen (even though if you tap on a discussion you will notice you are still logged in)

  • dave1707dave1707 Mod
    Posts: 8,555

    @Simeon When it shows me as logged out, I'm not able to see the following discussions.

    Moderation
    Members Only
    Project Beta
    Beta
    CC
    
  • SimeonSimeon Admin Mod
    Posts: 5,400

    @dave1707 that's correct, it's serving a cached page. I tried to get around it by appending the current time to the request for the main page, I'll try some other ways. Closing and opening the forums from the main screen should make it re-cache a new main page.

  • Posts: 1,976

    Editor error: the Codea function noTint() is not tinted green like all the other Codea functions are.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    Thanks @SkyTheCoder

  • Jmv38Jmv38 Mod
    Posts: 3,297

    [help panel bug]: small but desorienting.
    1- click physics.body.
    2- scroll down to the end of the topic.
    3- click physics.contact: the section opens at the end, instead of opening at the beginning. So i have to scroll back to the top.
    It seems that the browsing feature remembers the scroll position of last topic, even if not the same.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    Thanks @Jmv38, fixed in next beta (though I probably won't be distributing that on old-testflight)

  • Posts: 1,976

    @Simeon Maybe you could use the same trick you did on the forums to add that COPY button to code on GitHub too, as suggested here: http://codea.io/talk/discussion/6231/codea-browser-question#latest

  • SimeonSimeon Admin Mod
    edited February 2015 Posts: 5,400

    It adds the button to all pre tags, so this will work on GitHub if you press the "Raw" button on a gist. (Note this only works from the Codea Talk forum button, not the in-app browser via openURL)

    I didn't add it to the in-app browser in case it caused issues with people's projects.

  • edited February 2015 Posts: 1,976

    I narrowed down my previous problem with the water: Meshes that use a shader that modifies their vertex positions in the vertex program have incorrect zDepth values and cause weird depth order issues.

    Example: run this program, draw something, then switch the "edit" parameter and spin the camera around. You should see some pretty weird stuff happening (all the shader does is offset the vertex positions)

    -- 3D Displacement
    
    -- Use this function to perform your initial setup
    function setup()
        parameter.number("Camera Distance", 0.1, 10, 2.5)
        parameter.number("Camera Look Y", -5, 5, -3)
        parameter.number("Strength", 0.1, 1, 1)
        parameter.boolean("Edit", true)
        parameter.boolean("Editing Overlay", true)
        parameter.boolean("Eraser", false)
        parameter.integer("Brush Size", 2, 12, 12)
        parameter.integer("Brush Alpha", 2, 15, 15)
        pos = vec2(0, -1)
        height = 3
        m = mesh()
        local v = {}
        local tc = {}
        local y = 0
        s = 5
        local incr = 0.02
        for px = 0, s, incr do
            for pz = 0, s, incr do
                local x, z, inc = px, pz, incr
    
                table.insert(v , vec3(x, y, z))
                table.insert(v , vec3(x, y, z + inc))
                table.insert(v , vec3(x + inc, y, z + inc))
                table.insert(v , vec3(x, y, z))
                table.insert(v , vec3(x + inc, y, z + inc))
                table.insert(v , vec3(x + inc, y, z))
    
                x, z, inc = px / s, pz / s, incr / s
    
                table.insert(tc, vec2(x, z))
                table.insert(tc, vec2(x, z + inc))
                table.insert(tc, vec2(x + inc, z + inc))
                table.insert(tc, vec2(x, z))
                table.insert(tc, vec2(x + inc, z + inc))
                table.insert(tc, vec2(x + inc, z))
            end
        end
        m.vertices = v
        m.texCoords = tc
        m.texture = readImage("Planet Cute:Character Boy")
        m:setColors(color(255))
        m.normals = calculateNormals(v)
        m.shader = shader(Shaders.displacement.vS, Shaders.displacement.fS)
        img = image(100, 100)
        setContext(img)
        background(0)
        --[[fill(255)
        fontSize(24)
        font("HelveticaNeue")
        text("Hi", 50, 50)
        rect(50, 50, 25, 25)
        setContext()--]]
        m.shader.DISP = img
        m.shader.DISP_STRENGTH = Strength
        render = image(WIDTH, HEIGHT)
    end
    
    -- This function gets called once every frame
    function draw()
        -- This sets a dark background color 
        background(40, 40, 50)
    
        -- This sets the line thickness
        strokeWidth(5)
    
        -- Do your drawing here
    
        setContext(render)
        background(0, 0)
        if Edit then
            camera(s / 2, 10, -3.75 + s / 2, s / 2, 0, s / 2)
        else
            camera(pos.x * Camera_Distance + s / 2, height, pos.y * Camera_Distance + s / 2, s / 2, height + Camera_Look_Y, s / 2)
        end
        perspective(45)
        m.shader.DISP = img
        m.shader.DISP_STRENGTH = Strength
        m:draw()
    
        resetMatrix()
        viewMatrix(matrix())
        ortho()
    
        setContext()
    
        if Edit then
            sprite(img, WIDTH / 2, HEIGHT / 2, -WIDTH, HEIGHT)
    
            tint(255, 127)
    
            if Editing_Overlay then
                sprite("Planet Cute:Character Boy", WIDTH / 2, HEIGHT / 2, WIDTH, HEIGHT)
            end
    
            sprite(render, 50, 50, 100)
    
            noTint()
        else
            sprite(render, WIDTH / 2, HEIGHT / 2)
    
            tint(255, 127)
    
            sprite(img, 50, 50, -100, 100)
    
            noTint()
        end
    end
    
    function touched(touch)
        if Edit then
            setContext(img)
            if Eraser then
                fill(0, Brush_Alpha)
            else
                fill(255, Brush_Alpha)
            end
            noStroke()
            ellipse(100 - touch.x / WIDTH * 100, touch.y / HEIGHT * 100, Brush_Size)
            setContext()
        else
            pos = pos:rotate(math.rad(touch.deltaX))
            height = height - math.rad(touch.deltaY)
        end
    end
    
    function calculateNormals(vertices) -- Function made by @Ignatz, taken from his Lighting Library (LL)
        --this assumes flat surfaces, and hard edges between triangles
        local norm = {}
        for i=1, #vertices,3 do --calculate normal for each set of 3 vertices
            local n = ((vertices[i+1] - vertices[i]):cross(vertices[i+2] - vertices[i])):normalize()
            norm[i] = n --then apply it to all 3
            norm[i+1] = n
            norm[i+2] = n
        end
        return norm
    end
    
    Shaders = {
    displacement = {
    vS = [[
    //
    // Vertex shader with displacement modifier
    //
    
    //This is the current model * view * projection matrix
    // Codea sets it automatically
    uniform mat4 modelViewProjection;
    
    //This is the current mesh vertex position, color and tex coord
    // Set automatically
    attribute vec4 position;
    attribute vec4 color;
    attribute vec2 texCoord;
    attribute vec3 normal;
    
    //This is an output variable that will be passed to the fragment shader
    varying lowp vec4 vColor;
    varying highp vec2 vTexCoord;
    
    uniform lowp sampler2D DISP;
    
    uniform highp float DISP_STRENGTH;
    
    void main()
    {
        //Pass the mesh color to the fragment shader
    
        lowp vec4 dispVal = texture2D(DISP, texCoord);
    
        highp float avg = dispVal.r + dispVal.g + dispVal.b;
    
        avg /= 3.0;
    
        highp float mult = DISP_STRENGTH * avg;
    
        highp vec4 disp = vec4(normal.x * mult, normal.y * mult, normal.z * mult, 0.0);
    
    
        vColor = color;
        vTexCoord = texCoord;
    
        //Multiply the vertex position by our combined transform
        gl_Position = modelViewProjection * (position + disp);
    }
    
    ]],
    fS = [[
    //
    // A basic fragment shader
    //
    
    //Default precision qualifier
    precision highp float;
    
    //This represents the current texture on the mesh
    uniform lowp sampler2D texture;
    
    //The interpolated vertex color for this fragment
    varying lowp vec4 vColor;
    
    //The interpolated texture coordinate for this fragment
    varying highp vec2 vTexCoord;
    
    void main()
    {
        if (!gl_FrontFacing) discard;
    
        //Sample the texture at the interpolated coordinate
        lowp vec4 col = texture2D( texture, vTexCoord ) * vColor;
    
        if (col.a < 0.7) discard;
    
        //Set the output color to the texture color
        gl_FragColor = col;
    }
    
    ]],
    },
    }
    

    Edit: also, minor bug: running a project that has a supportedOrientations call that forces the project to run in a different orientation than what you were already in causes the keyboard to be in that orientation until you manually change the orientation)

  • Posts: 1,976

    Kind of a bug: the function collectgarbage is not autocompleted or highlighted. (It is a function built in to Lua that frees up unused memory, I've found that calling it in draw can be a solution to a lot of problems in which the Codea application itself crashes to the home screen due to running out of memory.)

  • Posts: 1,976

    Just wanted to let you know that I backed up and reset my iPad, re-installed Codea and its files from my backup, and now Dropbox can link, my settings are saved, and I can check my background. I guess something weird just happened when I got really low on space and opened Codea.

  • SimeonSimeon Admin Mod
    Posts: 5,400

    @SkyTheCoder thanks for letting me know. Glad it's resolved for you.

    By the way, are you noticing the editor slowness since 2.2 that @Luatee reported in another thread?

  • Posts: 2,043

    Bug with the forum code copy: if you click a YouTube video (like in Luatees Aedif video), all the code boxes now have three copy buttons.

  • Posts: 2,043

    Editor issue: the special keyboard buttons got stuck everywhere in codea.

    Trying to replicate.

Sign In or Register to comment.