SFML community forums
Help => General => Topic started by: BarryLarry17Jr on July 26, 2020, 03:41:07 pm
-
Right now i am loading a texture from this directory:
arrow.loadFromFile("/Users/oliverswan/Desktop/SFML/Coin\ Flip/Coin\ Flip/arrow.png");
But I want to load from my project folder which is the first Coin Flip Folder. Help!
-
Nice chaos. Don't use system paths and don't put files on your desktop.
Create folder on C:\ like "C:\Dev", put all your projects there, then put your assets (graphics, audio..) into specific project folder and use relative path, which will be just name of file or something like "Textures/texture.png" if you create extra folders.
-
If the working directory is (definitely) the first coin flip folder, you can use the rest of the path as a relative one: "Coin Flip/arrow.png". If the working directory is the second coin flip folder, the relative path would just be the file: "arrow.png".