The following code…
1 function UILoadObjectImage (filename, nodename)
2 filename = “assets/images/scene-objects/”…filename…".png"
3 print(filename)
4 local file = io.open(filename, “rb”)
5 local bytes = file:read("*a")
6 local png = image.load(bytes)
works when I do a build in the editor but in HTML bundle or even a Mac bundle it fails. I get an error on line 5. “attempt to index local ‘file’ (a nil value)” I thought it might be a path issue but it doesn’t seem to be – any ideas?