Tip: The SFML example comes with a
resourcePath() function which you have to put before the paths to load resources. You can use
tgui::setResourcePath(resourcePath()) at the beginning of your program so that everything tgui loads starts with that folder.
If you use homebrew then you can install the unofficial TGUI formula by executing:
brew install tgui
Alternatively, you can download the source code from the download page and follow the ‘building with CMake’ tutorial for a guide on how to build TGUI.
After you ran
make like explained in the tutorial, you should call
sudo make install to install the libraries which you just built.
Instructions are provided below for using either a dylib or framework library. When TGUI is installed with homebrew, you will have dylib files.
Step 2b: Select “Add Files” from the “Add Other…” dropdown menu. Navigate to the TGUI and SFML dylib locations and include their respective libraries. If you installed using homebrew, this location should be
/usr/local/Cellar. If you installed using CMake, this location is the “lib” folder in your build location.
Step 5: Navigate to Project -> Build Settings -> Search Paths -> Header Search Paths. Double click the blank space next to “Header Search Paths,” select the “+” icon, then enter the paths to the library headers. If you installed with homebrew, this location should be
/usr/local/include. Otherwise, the “include” folders will be located in your initial TGUI and SFML download packages.
Frameworks no longer worked when last tested. Unless you have experience with macOS it is recommended to use dylib files for now.