SFML community forums

Help => Graphics => Topic started by: myrupsaple on September 02, 2016, 01:22:27 am

Title: [SOLVED]Graphics load in XCode but not in .app
Post by: myrupsaple on September 02, 2016, 01:22:27 am
Hi,
I recently started using SFML and ran into some graphics issues when trying to run my program through the executable .app ("Tutorials.app") file.  Basically, I'm using .loadFromFile to load a background and player image, and everything works fine when I run it in XCode, but when I try to run it through Tutorials.app, the background is black and the player image is white.  I'm using the relative directory "Images/Background.png", where the images folder is located in the same folder as Tutorials.app. 

What I have tried so far:

Am I just using the wrong directory, or am I missing something altogether here?
Title: Re: Graphics load in XCode but not in .app
Post by: Hiura on September 03, 2016, 10:44:31 am
Please read again the getting started tutorial for OS X, from top to bottom (and mostly the bottom).
Title: Re: Graphics load in XCode but not in .app
Post by: myrupsaple on September 04, 2016, 06:55:52 am
I have all the image files in my Resources folder (the one in XCode) but they still don't show up when I run the program outside of XCode.  I assume that's what you were referring to.  If not, I'd appreciate if you could be a little more specific.
Title: Re: Graphics load in XCode but not in .app
Post by: Hiura on September 04, 2016, 11:50:17 am
Look for the resourcePath function.
Title: Re: Graphics load in XCode but not in .app
Post by: myrupsaple on September 04, 2016, 04:53:25 pm
Ahh I see now.  I was unsure of how to use the resourcePath function but it makes sense now.  Thank you.