diff --git a/examples/cocoa/CMakeLists.txt b/examples/cocoa/CMakeLists.txt index 7312bf71f..9713a2dde 100644 --- a/examples/cocoa/CMakeLists.txt +++ b/examples/cocoa/CMakeLists.txt @@ -14,6 +14,7 @@ set(XIBS MainMenu) # all resource files set(RESOURCES ${SRCROOT}/resources/logo.png ${SRCROOT}/resources/icon.icns + ${SRCROOT}/resources/sansation.ttf ${SRCROOT}/resources/blue.png ${SRCROOT}/resources/green.png ${SRCROOT}/resources/red.png diff --git a/examples/cocoa/CocoaAppDelegate.mm b/examples/cocoa/CocoaAppDelegate.mm index 389a6e717..ff1bc1e78 100644 --- a/examples/cocoa/CocoaAppDelegate.mm +++ b/examples/cocoa/CocoaAppDelegate.mm @@ -54,11 +54,17 @@ struct SFMLmainWindow unsigned int ww = renderWindow.getSize().x; unsigned int wh = renderWindow.getSize().y; sprite.setPosition(sf::Vector2f(ww, wh) / 2.f); + + if (!font.loadFromFile(resPath + "/sansation.ttf")) { + NSLog(@"Couldn't load the font"); + } text.setColor(sf::Color::White); + text.setFont(font); } sf::RenderWindow renderWindow; + sf::Font font; sf::Text text; sf::Texture logo; sf::Sprite sprite; diff --git a/examples/cocoa/resources/sansation.ttf b/examples/cocoa/resources/sansation.ttf new file mode 100644 index 000000000..d85fbc81d Binary files /dev/null and b/examples/cocoa/resources/sansation.ttf differ