Howdy, Stranger!

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

Codea 2.6.3 (132 & 133)

SimeonSimeon Admin Mod
edited December 2018 in Beta Posts: 5,054
  • Fixes Codea disconnecting your bluetooth headphones and putting your music on public display when playing sounds in the app, sorry about that!
  • Fixes bug where using noSmooth + line could cause a crash
  • [Beta] New code editor now supports sidebar for documentation and dependencies
  • [Beta] Please let me know what you think of the sidebar UI here, try to break it too
  • [Beta] You can invoke the sidebar by going to the Do menu and choosing Documentation or Dependencies
  • [Beta] Note: new dependencies view is non-functional at the moment

Special note: please try to break the sidebar in the new code editor :smiley:

«1

Comments

  • Posts: 1,400

    @Simeon - still can’t add blank tab or Class tab - not yet implemented?

    Now starting to look neat and tidy. Not sure about the edit menu, just preference but you could slide out the menu horizontally over the tabs and back when selection made or return button pressed - just an idea. I find horizontal buttons easier than menus.

  • Posts: 1,400

    @Simeon - just found another funny with current keyboard. Added a ne tab named blan. Pasted a lot of code in. Tried to scroll the text but it wouldn’t. Switched to main tab and only had a little code so no scrolling, then switched back and new tab scrolled properly.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon Where’s the Craft dependency in the new editor. Also, I copied a craft program into a new project, when I ran it the screen was blank. I exited Codea and came back in and ran it, it gave Craft errors because Craft wasn’t checked as a dependency.

  • Posts: 81

    Bluetooth headphones no longer seem to disconnect. However, when re-opening/closing Codea and sometimes when running or stopping a Codea project, music playback is interrupted for a split second.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon I think you need to change what shows in the dependency list. Create some way that a project will show as a dependency instead of every project with 2 or more tabs.

  • SimeonSimeon Admin Mod
    Posts: 5,054
    @dave1707 at the moment I have made it so that projects which are imported are at the top. And when you select one it floats to the top

    Are you suggesting you would need to mark a project as being available as a dependency before it shows up in the list?

    On the Craft dependency I’ll either add it again or I was thinking... just get rid of it and make every project include Craft.

    @Leon thanks for checking, not sure how to get rid of the stutter when you switch apps. I’m looking into it, but it seems like when I change the audio session category to playback and record (for the mic library) it stutters.
  • dave1707dave1707 Mod
    edited December 2018 Posts: 7,923

    @Simeon I have a lot of projects and just a few of them are multi tab which show in the list. None of them would ever be used as a dependency. I can't imagine having a dependency list with a couple hundred projects. I think there should be a way for someone to mark their projects as dependencies. Maybe something like saveProjectInfo dependency=yes.

    PS. As for the Craft dependency, I don’t know if I like the idea of every project including Craft. I’m not sure exactly what that does to a project. Does that always affect the code or only if a Craft function is called.

    PSs. Did some checking and it’s only a few more bytes to include Craft as a dependency. Below is what’s added to the plist file, so I guess it doesn’t matter if Craft is always included.

    <key>Addons</key>
        <array>
            <string>Craft</string>
        </array>
    
  • SimeonSimeon Admin Mod
    Posts: 5,054
    @dave1707 it just includes the craft code so you can use it. Might make projects a little slower to start (going to measure this)
  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon I was able to recreate the bug where the code wouldn’t scroll in the new editor.

    1) Create a new project then close it.
    2) Go to another project and copy some code, more than a page worth.
    3) Open the original project, delete the code and paste in the new code.
    4) Try to scroll the code, it doesn’t.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon When I try to scroll the new dependency list, it’s rather jerky in the beginning. As it slows down, the scrolling smooths out. Actually, in the old editor, when I try to scroll the project list, the same thing happens. That was also happening in previous releases. Maybe they’re related.

  • edited December 2018 Posts: 1,400

    @dave1707 - more or less what I did, I think it may be due to the new tab retains the code/page length of the main tab and doesn't update it when new code is pasted in.

    On the Craft dependency - question, is the Codea runtime loaded into memory when you run Codea code? if so then I would expect the Craft code to be loaded if it is included as a dependency. So the memory could be still taken up. Not a problem if you have a machine with loadsa memory.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Bri_G @Simeon That’s not what I ran into. I posted a lot of code into the original project and made sure it scrolled. I closed it and copied long code from another project. I went into the original project, deleted the code and pasted in the new code. It wouldn’t scroll. So I don’t think it has anything to do with what was originally there.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon Ignore the jerky scrolling of the project list in ver 132. I just tried it and the project list scrolling was smooth no matter how fast I tried to make it go.

  • Posts: 1,400

    @dave1707 - so deleting the code reset the code/page size and it didn’t correct when new code was pasted in.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon Something a little off. If I have a project opened in the new editor and slide my finger from off screen on the left onto the screen, the editor moves the text screen about a half inch to the left and moves it as I move my finger right until it’s back to normal. I can’t do it every time, but I can make it happen a lot.

    @Bri_G Even though the old code scrolled OK, the new pasted code wouldn’t scroll.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon I can make the screen slide a half inch left all the time now. This is on my iPad Air, with the new editor I’m not sure if this happens on other devices. Open a project in the new editor. Near lines 16 and 17, slide you finger from off screen onto the screen. The text screen should move 1/2 inch left. It only seems to happen near lines 16 and 17.

  • SimeonSimeon Admin Mod
    Posts: 5,054
    @dave1707 how did you find that! I was worried someone might find that tiny touch area when the sidebar is hidden but I couldn’t trigger it myself so thought not to disable it. Obviously I need to disable it
  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon I don’t remember what I was doing when it first happened. I could make it happen every now and then and it took awhile to figure out how to do it all the time. I guess if something can happen, eventually someone will find it.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    Build 133 notes:

    • [New Editor] Bug where you could drag from the left edge at a specific point and cause the editor to shift back and forth slightly
    • [New Editor] Attempt to improve scrolling performance of dependency list
    • [New Editor] Bug where pasting a lot of text into an empty file could sometimes limit scrolling
    • [New Editor] Project dependencies float to top when selected, still non-functional though
    • Bug where action parameters defined in global scope did not correctly run on first load of project
    • Memory leak with legacy code editor
    • Bug where a project’s buffer order could be incorrectly loaded if it received an automatic dependency fixup
    • You don’t need to include Craft any more, all projects will include it by default (setting needs to be removed from legacy dependency view)
  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon

    The drag from the left at lines 16 and 17 doesn’t happen anymore.

    Posting a lot of text into an empty project scrolls the way it should.

    Scrolling the dependency list still looks sticky. If I give it a fast flick, it seems to jump for a second or so then settles down and scrolls smooth.

    When you say selected dependencies float to the top, do you mean when a dependency is selected in one project, it will show at the top of any other project dependency list. If so, that sounds like a nice fix. That would prevent having to scroll through the list all the time.

    Haven’t tried the other fixes, not sure how to check them yet.

  • dave1707dave1707 Mod
    edited December 2018 Posts: 7,923

    @Simeon

    Keying “function xxx()” then pressing “enter” doesn’t indent the next line or add the “end” word for the function.

    Putting “parameter.action” outside of the setup function doesn’t seem to work. Is that what you’re referring to above.

    Not having to check Craft as a dependency works.

    Tried checking some dependencies. They float to the top. When they stay there from project to project will be great.

    When you float the dependencies to the top, are you going to sort them or leave them first checked first show. PS. Not sure what order they’re in.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 they would just be imported for the current project — similar to the way the current dependency list works. What I might do instead of declaring a project a library is add a way that projects can be excluded from the dependency list (then exclude most of the examples by default).

    Did the function xxx() thing happen in the new code editor? Does it always happen? I've noticed that sometimes the new code editor loads without the correct code semantics used for auto-indentation.

    parameter.action appears to work for me outside of setup(), in that the button shows in the sidebar and I can press it when I run the project. Any more details on this?

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon I don’t remember you mentioning showing the current tab name at the top and then showing a list of tabs to select from. That’s a lot better than scrolling the tabs across the top.

    Just noticed that the Example and Craft projects aren’t in alpha order like I have set for my projects. No big deal though.

  • SimeonSimeon Admin Mod
    edited December 2018 Posts: 5,054

    @dave1707 that only happens in compact mode — if you drag the sidebar to make the app small enough or get a second app on the screen in split-view.

    Edit: I was thinking maybe we should use the drop down always if you have a lot of tabs. Not sure though.

    The Examples and Craft follow their own special ordering (it was a bug in past releases that was making them follow the alpha/recent order)

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon

    The function xxx() was in the new editor and I was able to make it happen again after a couple of tries. Not sure what I had to do though. I’ll play around and see what needs to happen.

    I'm having trouble with the new editor saving/running the correct code after making changes. I was able to have the parameter.action not work outside of setup, but I’m not sure if that’s because I changed the code and it wasn’t there when I ran it. I’ll have to play with that also.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 the new editor still doesn't force a save prior to running a project. It will eventually! Just haven't got around to fixing that yet.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon That’s what I was thinking I’m running into. I’m making changes and running the code in fast cycles. I’ll have to make sure the code is saved before I try things.

  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon Here’s the parameter.action that I was trying to test. I don’t know if this is what you were saying above. Both parameters show in the sidebar, but only the “yes” action works.

    parameter.action("no",no)
    
    function setup()
        parameter.action("yes",yes)
    end
    
    function yes()
        print("yes")
    end
    
    function no()
        print("no")
    end
    
  • SimeonSimeon Admin Mod
    Posts: 5,054
    Oh maybe because the “no” function is undefined at the point where you create the action. Does it work if you move the parameter action after the declaration of the no function?
  • dave1707dave1707 Mod
    Posts: 7,923

    @Simeon parameter no works when it’s placed after function no(). I always put the parameter stuff inside setup() because I learned long ago that some thing don’t work outside of setup(). I tried it this way because I thought that’s what you mentioned in the bug fixes.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    Thanks for testing it. So it wasn't working at all previously, now it will work globally if the function is declared inside the action block or if it references a function that has already been declared.

  • dave1707dave1707 Mod
    edited January 3 Posts: 7,923

    @Simeon I was looking at some code in the Froggy example and then I tried playing it. Sometimes when the character jumped on a log, the screen would go crazy, then black, and Codea would eventually crash when I tried to do something. I’ve tried it several time and it seems to mess up only on the logs. Ver 2.6.3 136.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    Damn, looking into it

  • Posts: 1,400

    @dave1707 - just tried froggy and crashed on collision with a car.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 @Bri_G I think @John has this fixed for the next update

  • edited January 4 Posts: 419

    @Simeon i guess you are aware that the run arrow in the keyboard does not work in the new editor?

    @Simeon i find it annoying that i have to scroll to the top of the project selector to make the codea talk button appear. Could you keep the codea button visible?

    @John i have not succeeded to applyTorque to an entity in AR, does it work? I can make it work in ‘normal 3D’.

  • dave1707dave1707 Mod
    edited January 3 Posts: 7,923

    @piinthesky There’s a lot of things that don’t work on the keyboard with the new editor. Probably once the new editor is made the only editor, the keyboard will change to reflect that.

    I’ve never used Codea Talk from the project list. I have Codea and Codea Talk in the app bar (or whatever it’s called) at the bottom of the iPad screen.

  • Posts: 419

    @dave1707 how do you add codea talk to the app bar, as far as i know it is not an app?

  • dave1707dave1707 Mod
    Posts: 7,923

    @piinthesky start Safari then in the address area key Codea.io/talk . When that bring up the forum list, in the upper right corner is a square with an up arrow in it. Press that and you’ll get a list of options. Look thru the list for “Add to Home Screen”. Press that and it will create an icon that you can drag to the app bar.

  • Posts: 419

    @dave1707 great, didn’t know about that!

  • dave1707dave1707 Mod
    Posts: 7,923

    @piinthesky You can use that to create icons to take you to any web page.

  • edited January 4 Posts: 1,400

    @Simeon - getting the problem with the comment delimiters acting up again. We resolved that in a previous version. I’ll see if I can cut out a small section of code to demonstrate.

    Edit: played with the code again but couldn’t duplicate it, it was in the working editor. If it occurs again I’ll post it.

  • Posts: 1,400

    @Simeon @John - is the difference between sprite and mesh here genuine or a bug?


    -- TestText displayMode(OVERLAY) function setup() -- bkg = readImage("Environments:Night Up") mX,mY = WIDTH/2, HEIGHT/2 myMesh = mesh() sz = 480 -- build mesh and add texture myMesh.vertices = { vec2(200,200),vec2(200+sz,200),vec2(200,200+sz), vec2(200,200+sz),vec2(200+sz,200+sz),vec2(200+sz,200) } myMesh.texture = bkg myMesh.texCoords = { vec2(0,0),vec2(1,0),vec2(0,1), vec2(0,1),vec2(1,1),vec2(1,0) } -- take image and stretch to same size as mesh itest = image(sz,sz) spriteMode(CENTER) setContext(itest) sprite(bkg,sz/2,sz/2,sz,sz) setContext() end -- This function gets called once every frame function draw() -- This sets a dark background color background(40, 40, 50) myMesh:draw() sprite(itest,240,700,480,480) end

    Does it relate to 3D and light settings?

  • dave1707dave1707 Mod
    Posts: 7,923

    @Bri_G I’m not sure what you’re trying to show. Is it the difference in the color of the images. If so, try putting fill(255) after background(40,40,40).

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @Bri_G Odd, looks like a bug but fairly minor — the default mesh vertex colours are not white, which is causing the mesh colour to multiply with the texture colour and dim the image.

    Try setting the mesh vertex colours to white like this:

        myMesh.colors = {
            color(255), color(255), color(255),
            color(255), color(255), color(255),
        }
    

    Will double check with @John what our default should be here.

  • Posts: 1,400
    @dave1707 @Simeon - thanks for the replies, from your posts I am assuming that a mesh is transparent and requires a background of white to show true colours. Will test your suggestions out when I get access to my pad.

    Seem to remember in early mesh examples setting default color to white.
  • SimeonSimeon Admin Mod
    Posts: 5,054

    Yeah white as the default makes sense. Not sure what's going on there.

  • edited January 5 Posts: 1,400

    @dave1707 - thanks, it is due to transparency. If you do as you suggested but put fill(back) in after the background and parameter.color(“back”) at the beginning of setup() you can change the default background for meshes. The default must be transparent.

    Interesting, as a sprite the white background is present, but in a mesh it is removed?

  • Posts: 1,400

    @Simeon - just tried OMG = image(CAMERA) in setup() and it didn’t take a snapshot. Is that deliberate? Is CAMERA only available from draw() ?

    Makes sense in a way - you can’t see the image your taking a snapshot of.

  • dave1707dave1707 Mod
    edited January 5 Posts: 7,923

    @Bri_G Apparently setup has to finish before CAMERA works. If I run this code, I have to tap the screen twice before an image shows. If I uncomment the line in setup, then I only have to tap the screen once. If I add a large for loop around img=image(CAMERA) in setup, it still doesn’t show the image until I tap the screen.

    function setup()
        --img=image(CAMERA)
    end
    
    function draw()
        background(0)
        fill(255)
        text("tap screen for camera",WIDTH/2,HEIGHT-50)
        if img~=nil then
            sprite(img,0,0)
        end
    end
    
    function touched(t)
        if t.state==BEGAN then
            img=image(CAMERA)
            print("image info  ",img)
        end
    end
    
Sign In or Register to comment.