@Simeon - are the statements/commands LANDSCAPE_LEFT and LANDSCAPE_RIGHT functional? I tend not to use them as I try to fix orientation myself. If they are variables which you can detect and respond to - fair enough. Otherwise the only thing they seem to do is temporarily lock out the control buttons.
I think an alternative would be to use ASPECT which could be used to determine orientation > or < 1, but also device type if you build a list of device aspects for phone, pad or Mac which could help developers.
@Bri_G This is how I use them to force the device into a particular orientation. By doing this, you can bypass running code until the device is in the orientation you want.
viewer.mode=FULLSCREEN
function setup()
fill(255)
count=0
end
function draw()
background()
if CurrentOrientation~=PORTRAIT_UPSIDE_DOWN then
text("rotate device to portrait upside down orientation",WIDTH/2,HEIGHT/2)
text("I won't increment count until you're in portrait upside down orientation",WIDTH/2,HEIGHT/2-50)
else
count=count+1
end
text("count "..count,WIDTH/2,HEIGHT/2-100)
end
I deprecated this function because it was a little too buggy at runtime. Best practice is to support any and all orientations — as the user can even split-screen multitask and squash the Codea window into a portrait aspect when in landscape, or make it skinny like an iPhone display
So far the only time I lose code is when I make a change and the project cancels when I run it. Normally I’ll do the save and run option if I have a lot of code changes or I think the code will crash.
@Simeon - just plugged my iPad into my Mac, I was looking for a way to transfer data from Mac2Pad and back. Post on net shows how to add to finder then click on show in finder. Voila, my Pad is there. The post says to see files etc go to files in the button bar, and there were most of my iPad installed apps.
But, no Codea. Is there a reason for this, or a way of including it, it would be an ideal way of transferring data/resources ?
Also, on the latest beta I note projects are listed as project.codea and tapping on them runs them. Would it be possible to add a long press to open the project so we can exchange files as needed? Or is there another way of opening them.
A little explanation of the modifications incorporated with the new Documents (ie root) folder could be useful.
Really sorry about that @UberGoober, it sounds very frustrating. This has been happening ever since I adopted the iOS Document model and relied on its “autosaving” behaviour instead of just writing the files directly. I’ll spend some time tonight trying to reproduce and debugging it
@Bri_G good point on being able to look “inside” a Codea project. This is something we are doing for Codea 4.0, where projects behave much more like folders when opened
@Simeon - nice to hear 4 will be more file orientated rather than purpose built filing. Very used to the latter but filing is ingrained in me (old git).
Funny I noted recently, trying to set up a timer with socket() and the project hung up on me - that was in the editing mode, run button didn’t respond. Think it was after running. Does repeated calling for socket() cause problems with Codea.
@Simeon I’m trying to remember… I don’t think I did… I was switching back and forth between two tabs a lot, because I was doing Unit tests and I kept forgetting what the names of my methods were, and I noticed the bug when I had gone to the tab I was testing and then tried to go back to the tab with the test code…
@UberGoober I think I’ve tracked it down to how Codea is loading projects. I’m uploading a new build of 3.4.3 with a lot of underlying changes and hope that it fixes the bug
@Simeon just happened again, lost code, although the weird “loading…“ thing didn’t happen. This time I think I did run the project before losing the code.
@Simeon Version292 doesn’t keep the sort by name. If you do sort by name, sometimes it works but if you exit Codea and go back in it sorts by recents even though name is still selected.
@Bri_G Are you saying when you start Codea and then load a project, it takes ages to show in the editor. The largest project I can find is Cargo-Bot and that loads/runs immediately.
@dave1707 - no in a word. What happens is when I run Codea it goes to the project page with a semitransparent side window on the left and the two icons for settings and assets at top right with the background image there. At that point it takes quite a while before you see the collection icons and then further long time before you see the project icons appear.
I have been playing around with the files/assets in the Codea root to try to resolve my Dropbox problem. I think there may be a clash there or I may have too many files in the root. Had to transfer some files from Dropbox to Mac then to Codea from Mac into the root so that I could run my projects. Now Dropbox is nearly empty but working. Think I may have to empty the Codea root next.
@Simeon does Codea keep a separate list of files in the Codea root for checking on boot up or does it just build a dierectory when booting?
p.s. I did have some folders in the Codea root which were named like folder.assets which I renamed to folderAssets as I wasn’t sure that the original naming was valid in the latest Codea versions since projects moved from ‘project’ to ‘project.codea’