The code:
local path = system.pathForFile(“myimage.jpg”, system.DocumentsDirectory)
local image = display.newImage(path)
The response:
WARNING: Failed to find image(/Users/mark/Library/Application Support/Corona Simulator/image_trim-C3A1B2DB4616B8CAB2A54233D757EDE8/Documents/myimage.jpg)
Check file really exists:
~ mark$ ls “/Users/mark/Library/Application Support/Corona Simulator/image_trim-C3A1B2DB4616B8CAB2A54233D757EDE8/Documents/myimage.jpg”
Yes, it does (ls response):
/Users/mark/Library/Application Support/Corona Simulator/image_trim-C3A1B2DB4616B8CAB2A54233D757EDE8/Documents/myimage.jpg
Path has spaces. Let’s wrap it in quotes:
local path = system.pathForFile(“myimage.jpg”, system.DocumentsDirectory)
local image = display.newImage(""" … path … “”")
WARNING: Failed to find image("/Users/mark/Library/Application Support/Corona Simulator/image_trim-C3A1B2DB4616B8CAB2A54233D757EDE8/Documents/myimage.jpg")
Nope.
In previous SDK versions this worked as expected, but not now. How come?
It’s easy to get around for newImage, as you just pass the base directory parameter, but it you want to load a sprite sheet you’re stuck with the old syntax and it won’t load.
Would appreciate help or confirmation that this is - or isn’t - a problem. [import]uid: 3953 topic_id: 6316 reply_id: 306316[/import]