SFML community forums
Help => Graphics => Topic started 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:
- Copying both Tutorials.app and the images folder into a new directory outside of the default one
- Using the directory within Tutorials.app (/Contents/Resources/background.png)
Am I just using the wrong directory, or am I missing something altogether here?
-
Please read again the getting started tutorial for OS X, from top to bottom (and mostly the bottom).
-
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.
-
Look for the resourcePath function.
-
Ahh I see now. I was unsure of how to use the resourcePath function but it makes sense now. Thank you.