Setting baseDir

I want to set my button to get its image from the “assets” folder that’s located in the project folder, but I can’t figure out how to get it to work. 

playBtn = widget.newButton{

label=“Play Now”,

labelColor = { default={255}, over={128} },

baseDir = “assets”,

defaultFile=“button.png”,

overFile=“button-over.png”,

width=154, height=40,

onRelease = onPlayBtnRelease

}

I’ve also tried ‘baseDir = “\assets”,’ and that didn’t work.

  1.  Thanks for formatting your code so it is legible.  Note, however that there is a blogging tool/option to format code:

formatyourcode.jpg

  1.  You are misunderstanding ‘baseDir’.  That is specifying if the root is considered to be one of these:

If your files are in a sub-directory of the ‘resource directory’ you need to do this:

playBtn = widget.newButton{ label="Play Now", labelColor = { default={255}, over={128} }, defaultFile="assets/button.png", overFile="assets/button-over.png", width=154, height=40, onRelease = onPlayBtnRelease }
  1.  Thanks for formatting your code so it is legible.  Note, however that there is a blogging tool/option to format code:

formatyourcode.jpg

  1.  You are misunderstanding ‘baseDir’.  That is specifying if the root is considered to be one of these:

If your files are in a sub-directory of the ‘resource directory’ you need to do this:

playBtn = widget.newButton{ label="Play Now", labelColor = { default={255}, over={128} }, defaultFile="assets/button.png", overFile="assets/button-over.png", width=154, height=40, onRelease = onPlayBtnRelease }