Howdy, Stranger!

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

Codea 3.0 (106)

245

Comments

  • edited February 2018 Posts: 1,717

    Could I make a suggestion - on the dependencies menu I have previously suggested collapsible groups so that we can skim the dependencies faster. A simpler system to implement would be to have a moveable bar (like the one in the sidebar) where all above are copied from the lower list, when in use or most frequently used. This would allow rapid access to common ones like Craft and Cameras which I see being used more and more. Both above and below the bar should be independently scrollable.

    This could allow easy development of packages using libraries of routines - example testing of alternative routines for loading 3D models against source or file type like obj, ply, 3DS etc. As the libraries would be at the top of the top list.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Bri_G A while back I made a suggestion that we could add a tag or something at the beginning of a project to identify it as a dependency and only those projects would show in the list. That way we would have control over what’s in the list. If we want something from the examples to show as a dependency then we could add the tag to it if it didn’t have one to start.

  • SimeonSimeon Admin Mod
    Posts: 5,363
    @dave1707 you should be able to tap anywhere else on the screen to dismiss the new/duplicate project screen. I’ll have to add that function to the x button too.
  • Posts: 26

    Don't know if this has already been reported but under the current beta if I duplicate a project it just creates a new project.

  • dave1707dave1707 Mod
    Posts: 8,389

    @romspy Yes, that was reported on the first page. I was going to post the same thing a few days ago, but noticed it was already mentioned.

  • Posts: 26

    I read that page apparently didn't see it. Thanks

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon Putting the cursor in the () of sprite() doesn’t bring up the sprite assets to choose from. I haven’t checked if other commands don’t work like they used to.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @dave1707 ah good catch! I just broke that in cleaning up the old code. Will make sure it's restored. (The highlight comes back once you add something between the parentheses for now.)

  • @simeon i see you have a new build. if it includes the spotlight fix can you release it via testflight? i am eager to play with the spotlight!

  • SimeonSimeon Admin Mod
    Posts: 5,363

    Codea 3.0 103

    • Craft spotlight rotation fix
    • Fix duplicate project functionality
    • Fix crash when Add from Photos is selected in Documents folder
    • Fix crash when using color parameter on iPhone
    • Update Multi Touch example code to check for touches cancelled
  • dave1707dave1707 Mod
    edited February 2018 Posts: 8,389

    @Simeon The Craft spotlight rotation works. The project duplicate works. The add from photos works. The sprite() fix works. I don’t have an iPhone so I can’t check that and I don’t know about the multi touch.

    PS. I found the multi touch report. After restoring the examples, I couldn’t get a circle to remain.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @dave1707 thank you for checking through everything! I really appreciate it

  • @simeon, @john, yippie! the spotlight orientation is fixed. My submarine can find its way now!

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon Here’s something that doesn’t work quite right, but it doesn’t matter that much.

    1. Open a project.
    2. Tap screen to bring up the keyboard.
    3. Tap the eye icon to open the built in reference.
    4. Select Craft, then Craft.entity.
    5. Hide the keyboard.
    6. Notice that the text wraps correctly to show everything.
    7. Rotate the keyboard.
    8. Everything is truncated.
  • dave1707dave1707 Mod
    Posts: 8,389

    @piinthesky Interesting video. Can you make the submarine a little brighter so it shows up better. Enough so the submarine is visible but not enough to diminish the spotlight effect.

  • @dave1707 i could probably move the location of the spotlight towards the back, so it also illuminates more of the submarine. Otherwise i could use ‘basic’ material rather than ‘standard’ or ‘specular’. ‘Basic’ seems to be bright and ignores the ambient light level.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @piinthesky love your submarine video! You could have a couple of spotlights that are just anchored to the submarine and follow it around to give it a nice rim lighting effect

    @dave1707 thank you for the steps, will try it out

  • Posts: 1,717

    @Simeon - I know I have probably done something stupid but can you explain this:


    displayMode(FULLSCREEN) -- Use this function to perform your initial setup function setup() sW, sH, sW2, sH2 = WIDTH, HEIGHT, WIDTH/2, HEIGHT/2 square = image(96,96) setContext(square) fill(216, 30, 47, 255) stroke(225, 204, 80, 255) strokeWidth(5) rect(0,0,sW2,sH2) setContext() end -- This function gets called once every frame function draw() -- This sets a dark background color background(59, 110, 45, 255) sprite(square, sW2,sH2) fill(35, 93, 199, 255) stroke(175, 81, 228, 255) strokeWidth(5) rect(336,360,96,96) end

    With the ability to put emoticons in the sidebar I tried to ‘print’ sprites into the sidebar to try to set up a slide-on control panel for games etc. No joy, so I thought why not set up your own by drawing an image incorporating the sprites and sliding that on. But I had a problem with the image borders.

    Or, is this a flaw in Codea?

    Can you explain?

  • dave1707dave1707 Mod
    Posts: 8,389

    @Bri_G Is this what you’re trying to do.

    displayMode(FULLSCREEN)
    
    function setup()
        sW, sH, sW2, sH2 = WIDTH, HEIGHT, WIDTH/2, HEIGHT/2
        square = image(96,96)
        setContext(square)
            fill(216, 30, 47, 255)
            stroke(225, 204, 80, 255)
            strokeWidth(5)
            rect(0,0,96,96)
        setContext()
    end
    
    function draw()
        background(59, 110, 45, 255)
        sprite(square, sW2,sH2)   
        fill(35, 93, 199, 255)
        stroke(175, 81, 228, 255)
        strokeWidth(5)
        rect(336,360,96,96)
    end
    
  • dave1707dave1707 Mod
    Posts: 8,389

    @piinthesky I don’t know how you defined the submarine, but maybe you can do something like this. Both cubes are the same, but one is dark and the other is defined with the light and shows up bright.

    function setup()
        scene = craft.scene()
        scene.ambientColor = color(0)
        scene.sun.active = false  
        scene.sky.active = false  
    
        v=scene.camera:add(OrbitViewer, vec3(0,2,-4), 12, 0, 200)
    
        --create cube without light
        c=scene:entity():add(craft.renderer, craft.model.cube(vec3(1,1,1)))
        c.entity.material = craft.material("Materials:Standard")
        c.entity.material.map = readImage("Blocks:Trunk White Top")
        c.material.diffuse=color(255,255,0)
    
        --create light
        pt=scene:entity():add(craft.light,POINT)
        pt.entity.position=vec3(0,2,0)
        pt.distance=0 
    
        -- create cube with light    
        c=pt.entity:add(craft.renderer, craft.model.cube(vec3(1,1,1)))
        c.material = craft.material("Materials:Basic")
        c.material.map = readImage("Blocks:Trunk White Top")
        c.material.diffuse=color(255,255,0)
    end
    
    function update(dt)
        scene:update(dt)
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()    
    end
    
  • Posts: 1,717
    @dave1707 - oops, senior moment thanx for pointing it out. Knew it was obvious but couldn't see it. Duhhhh!!!!
  • @dave1707 @simeon, thanks! I have anchored a point source to illuminate the back....

    I also added a bright icosphere on the front to simulate the source of the spotlight...

  • dave1707dave1707 Mod
    Posts: 8,389

    @piinthesky That’s a lot better, being able to see the submarine.

  • edited February 2018 Posts: 175

    @Simeon Very minor issue with the 102 build on IPad but 103 has fixed. I was unable to revert to the App Store version by downloading again through there. The button was "Open" instead of the little cloud icon and stayed that way after restarting IPad. Almost insignificant but it's nice to know there's an easy way back when testing.

    Edit: Please disregard, actually seems to be an App Store bug on iOS 10. Icon just switched to Open for 103 after going onto updates screen (Codea is in my recently updated list) but installing something else fixes it.

  • arrrrggggghhhh! i thought i would tidy up a bit, so in the files app i created a folder for each of my ongoing projects and moved all the versions of the projects to their appropriate folder. When i went back to Codea all the files still exist but are now empty! if i look at their size in the files app they are zero bytes. @simeon any ideas if i can recover??

  • SimeonSimeon Admin Mod
    edited February 2018 Posts: 5,363

    @piinthesky I tried that and the projects stick around in Codea, but if I toggle the project icon size they disappear. When I moved the projects back out of the folder I'd created into the root Codea folder then toggled the project icon size once more my projects reappeared and were accessible.

    Edit: If you name your folder "Name.collection" in the Files app, then drag the projects in, they will appear in the project browser under a collection of that name (toggle the icon size to force a refresh). Not officially supported yet but it seems to work for me.

  • dave1707dave1707 Mod
    Posts: 8,389

    @piinthesky If you get all your projects back, the first thing you should do is an Export Projects that will backup all your projects into a single zip file. You can then import all or selected projects. You won’t have to worry about losing projects.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @piinthesky let me know if you have any luck. Could you possibly export the projects from the Files app by copying them elsewhere? Or sharing them

  • @simeon i have not figured out how to move them out of the new project folder i made back to root codea folder! it does not let me move them to ‘on my ipad’? The files app is a real mess! hopefully the size indicated by ‘info’ is wrong.

    i was wrong in my previous message-they did disappear from the codea main screen.

    i will continue to investigate.

  • SimeonSimeon Admin Mod
    edited February 2018 Posts: 5,363

    What did you name the folder you moved the projects into? Was it something like "Name.codea" or was it just a plain folder name?

    Edit: note all my projects say "Size 0kb" in the info window so I'm going to assume that's just wrong. Because mine all work fine.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon Did support for Export Projects break. I can do the Export Projects and have the zip file show in the Dropbox App. From the Dropbox App, I select the zip file ,I do an export, then Open In, then Copy to Codea. The Codea app opens, but does nothing. Codea should open a window showing the projects in the zip file and allow me to select what projects I want to import.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @dave1707 yes it hasn't been put back into version 3.0. I've just added it to the list so I don't forget!

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon Thanks. Just trying to keep everything working.

  • @simeon, the files app seems very inconsistent. this time i could move to the root codea and then hey presto after a toggle of the icon sizes i restored the project-phew!

    i will try to name the folders as .collection and see if that works.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    Maybe export them first for safety :P

  • adding the .collection extension is great, i see all the versions in the file folder nicely collected together on the main codea screen.
    thank you @simeon and @dave1707 for your precious help.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon supportedOrientations doesn’t seem to work. Also, placing the cursor inside the () doesn’t do anything unless you key a letter first.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @dave1707 I think supportedOrientations will need to be deprecated. It only works through hacking iOS but is generally no longer the recommended way of doing things. I think we'll replace it with a sizeChanged callback.

    How do you mean about placing the cursor inside () not doing anything? What is the expected behaviour.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon My mistake. For some reason I was thinking that placing the cursor in the () showed the valid options to choose from for supportedOrientations. When I couldn’t get supportedOrientations to work, I thought the cursor in the () wasn’t working either.

  • SimeonSimeon Admin Mod
    Posts: 5,363

    @dave1707 I need to make it do that, it would be much cooler and more useful.

  • Posts: 1,717

    @Simeon trivial issue, just loaded 103 and opened Shaders and it looked like I couldn’get out of the shader tool as I seemed to get the folder options up for the storage of shaders, Documents, Dropbox etc. I eventually managed to return to the main project screen when I realised you had to press the less than symbol just before load shaders option. Suggest make it more obvious by moving load shaders to right hand side of the tool.

  • edited February 2018 Posts: 1,717

    @Simeon - just a quick query, I seem to remember when FileApp came along that you could see the spritepack collections in the Codea root together with Dropbox, Document folders etc. I have just been adding new collections and noticed you can't see many of these. I have just re-installed so it may be that, I may have to re-install al the graphic libraries. Is this due to changes in Codea?

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon This may be happening just on my iPad because I have so many projects (500+), but here’s what I’m seeing. If I open a project near the end of my list of projects, then close it, the list always scrolls (unseen) to start showing at my 431st project. If I open a project and close it at a project less than that, the screen view of projects remains the same and you see the project shrink down into its icon. When I close a project near the end of my list, the project shrinks down to off the screen because the project was scrolled off screen because I’m viewing starting at my 431st project. I have the setting so I view 5 project icons across the screen in portrait mode. If I rotate my iPad to landscape, I have 7 projects across and I have to be almost at the end of my list for the problem to happen. Like I said, it’s probably just because I have so many projects and when it happens it’s no big deal.

  • the AR on the iphone now seems to work-cool!

  • Posts: 1,717

    @Simeon, @dave1707 - this is a funny one, I doubt whether anyone will encounter this but I thought it better you be aware of this. I have several files on my Dropbox Codea root which are text file backups using the @dave1707 backup project. I recently re-installed Codea and found the files in the text section of the assets\Dropbox resources. It loaded the file, which is fairly big, and I rocognised what it was. Whilst scrolling through it Codea crashed. This was reproducible.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Bri_G It does the same thing for me too. I guess looking at a extra large text file in the assets folder wasn’t intended to work. I never try to look at them there.

  • Posts: 1,717

    @dave1707 - I’d like to be able to archive assets from the Documents text section and shaders etc. It could be useful to set up recognised subdirectories in the Dropbox Codea root which we can store automatically downloaded files when we reinstall Codea. I’m going to tidy up my Codea root to avoid downloading files like these backups.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Bri_G Also include @Simeon when you make a request. It would be nice to have a backup that gets everything, including global and project data.

  • dave1707dave1707 Mod
    Posts: 8,389

    @Simeon Is there any want to include a dependency using code in a project similar to sockets, craft=require("Craft"). By having a line of code that adds a dependency, then you don’t have to go thru the list to check off all the dependencies that are required. Also, when sharing code on the forum, the person copying the code won’t have to see an error message as a reminder to check off the dependencies. This is no big deal, but might be useful.

  • Posts: 2,020

    @dave1707 I completely agree that the best way to handle dependencies in Codea would be to use a code-based solution, using a keyword like require or import. I guess LuaRocks is thebest-known Lua dependency manager. I have no idea whether LuaRocks support wouldbe out of scope in Codea
    https://luarocks.org/#quick-start

Sign In or Register to comment.