@dave1707 - the project loads a sprite, copies that to a memory sprite and reads touch to get a value for opaqueness. After touch the memory image is read per pixel and the opaqueness set to the computed touch value. Not finished, not debugged - and not working.
But, it seemed to hang up a little on me when trying to close, then back to project list window. I tried to close Codea but it came back up with a crash error on top of the Codea projects window. Never seen an error in that way.
@Simeon - not sure what your editing changes entail fully, but I am seeing some inconsistencies with placing the cursor. Usually at the bottom of the listing, the cursor sometimes appears to move up a line. Also I can’t always get the editing options up when I need to paste. I have no problems with placing the cursor on the line number though which emphasises as expected.
@Bri_G @Simeon I’ve also noticed when tapping near the bottom that the cursor is a few lines above where I touched. I thought it was just how I was tapping the screen and never went back to fully investigate it. I was always too busy working on something.
@Bri_G As for your above code, it seems to be working how you have it coded. I’ve tried it several times, but I haven’t had any crashes or other problems with it.
@dave1707 - funny, on my iPad the code doesn’t fade the lower image which was my intention. A slightly different version partially fades it - that one used a parameter call to set the opaqueness. Just playing with sprites to see if there was an issue with opaqueness as with your rectangle/ellipse routines. But as I said not yet finished.
@Bri_G Add this line of code after background(bck) and you’ll see the opaqueness as you tap the screen near the top or bottom.
sprite(asset.builtin.Cargo_Bot.Startup_Screen,0,0)
@Simeon The alert(“ ”) function causes a total Codea crash. Run this a tap the screen.
function setup()
end
function touched(t)
if t.state==BEGAN then
alert("crash")
end
end
@dave1707 - confirmed, tried the demo for alert in the reference with alert() added but still crashed.
@Simeon - I have returned to an old project which uses parameter.number with a range of 0.03 to 0.009. When you scroll the slider it rounds the figure displayed up to two decimal places. Is there any way to define the number of places defined as you lose the detail in scrolling. I know I can change the range to 1000 greater then divide the output by a 1000 but it seems a bit untidy. I would have thought that the output would have been scaled to the lowest level in the parameter definition for scaling. So 0.000 in my example above.
@Simeon - just playing around trying to read a directory of sprites in the documents folder. Messy code produced here:
function setup()
--
tab = {}
tabPNG = {}
s = {}
parameter.action("list png",showPng)
path = asset.documents
s = assetList(asset.documents,"sprite")
for a,b in pairs do
print(a,b)
end
end
Tried spriteList, assetList then tried above code to create the list of sprites - didn’t work so I tried placing the asset.documents in inverted commas ran - then crashed.
p.s. can’t find assetList in Codea reference section but it is present in Codea reference web site.
@Bri_G Heres something to look at.
function setup()
s=asset.builtin.Cargo_Bot.all
for a,b in pairs(s) do
print(b.name)
end
end
@Bri_G Here’s another.
function setup()
xx={}
tab1=asset.builtin.all
for a,b in pairs(tab1) do
tab2=asset.builtin[b.name].all
table.insert(xx,"\
\
"..b.name)
for c,d in pairs(tab2) do
table.insert(xx," "..d.name)
end
end
print(table.concat(xx,"\
"))
end
@dave1707 - thanks for that, I was actually using code from your first incarnation of your last post when I ran into the problem. That code used assets.builtin before @Simeon changed to asset.builtin.
@Simeon - another funny when I use assetList() it is not displayed as a keyword i.e. emphasised in green. Should it be? Or is it not really a function.
@Simeon - further on the asset front - I typed list = asset and no options popped up until I added the ‘.’ But whilst playing around with it, not able to reproduce it yet, I found assetl empasized in green as a displayed option. However assetl and assetL do not display the expected options. Like assetList is part of the system but not fully recognised.
@Bri_G the assetList
function still exists but is deprecated so no longer appears highlighted or in the documentation (and eventually may be removed)
@dave1707 thank you for finding the alert
crash
@Simeon @dave1707 - found an issue with 242, which I think has been present for a while. It’s to do with file addressing and hinges round the following line:
ent.model = craft.model(asset.documents.Dropbox.Gripe.model.Teapot.obj)
I started off with a directory Grip and tried changing the Grip to grip which seemed to be accepted. Then I changed Grip to Gripe and noted that Grip and grip were accepted with model as a possible sub directory. Does the parser for filepath retain all accumulated possible entries? After I dropped out of this project, ran another, the possible entries seemed to be present. Shouldn’t path histories be purged when entries are removed from a path. Is this to do with building up a parser list for suggestions?
With my memory this causes me some confusion - when I’m adding a path which is accepted but doesn’t exist and as such have no content.
Hope that’s not confusing.
i’ve formed the impression that codea caches some info like this. closing and opening the app has cleared the things i’ve seen.
@RonJeffries - thanks for that, summarised what I was trying to get over in one succinct statement.
@Simeon - noticed when creating a table of paths that if I paste another path without adding a comma after the last - that an error occurs stating that a’}’ is missin when it is the line above missing a comma. No biggie but can be confusing.
@Bri_G Errors being flagged on different lines have been happening since I started using Codea long ago. It’s probably next to impossible to flag what and where the exact error is. If that was the case, the editor would be able to automatically fix the errors. I don’t think any editor is capable of doing that.
@Simeon - Thanks for adding preferredFPS. It works a treat but I discovered a small issue where it’s ignored when minimising and then resuming the app while the project is running. I expect a timer variable needs resetting or something on resume.