gadss
gadss

Reputation: 22489

how display.newImage() to image from another directory in lua - corona

I just want to clean my project directory of my corona project so i want to group it using directories. example for all the images, i have a img directory.

my project directory is in C:\Documents and Settings\Administrator\My Documents\MyProject\img

so in my code i do

display.newImage("img.png",0,0,true)

to

display.newImage("C:\Documents and Settings\Administrator\My Documents\MyProject\img\img.png",0,0,true)

and

display.newImage("img\img.png",0,0,true)

but i got this error.

WARNING: Failed to find image(img.png)

my question is, how can i get the img.png from img directory using display.newImage()? and how can i get the directory path on it?

Upvotes: 0

Views: 4319

Answers (1)

SatheeshJM
SatheeshJM

Reputation: 3643

You need to give the forward slash

display.newImage("img/img.png",0,0,true)

Upvotes: 2

Related Questions