Accessing Resources
There are three folders for app resources: images
, script
, and misc
. To access resources from each folder, functions with names matching the folders are used.
Note
The misc
folder contains miscellaneous content, from lua modules, to audio, to csv files.
It is automatically added to package.path
Important
Put your own scripts
and images
in the scripts
and images
folders, respectively, and store third-party lua modules in the misc
folder and not in the scripts
folder.
Use the function image(path)
to access images. Apply this same concept to access resources in the other folders.
local button = Button('Next')
button:setIcon(images('next_icon.png')) -- this points to the icon inside the images folder
-- accessing subfolders
local button = Button('Play')
button:setIcon(images('folder1/folder2/folder3/play.png'))
Note
Do not use use ../
or ./
to access folders.