You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building an application for macOS, you typically will create a .app Application Bundle. These macOS applications follow a very specific directory structure:
The main game executable is at YourGame.app/Contents/MacOS/YourGame
The content files that are created by the content pipeline are in YourGame.app/Contents/Resources/Content
When attempting to do something like using a custom font with a command such as this
textInstance.CustomFontFile="fonts/04b_30.fnt";
Gum will look for that file path relative to the executable.
On Windows and Linux, this works fine since the Contents directory is relative to the executable, but for a macOS application bundle, the Content directory is not relative to the executable. Instead, from the executable it is ../Resources/Content.
MonoGame handles this in the TitleContainer automatically here by using a location value callled NSBundle.MainBundle.ResourcePath
This issue can be worked around by just simply placing the needed content files inside the MacOS/ directory relative to the executable. There is no rule against doing this, but it is not the common practice or the recommended setup for application bundles.
The text was updated successfully, but these errors were encountered:
When building an application for macOS, you typically will create a
.app
Application Bundle. These macOS applications follow a very specific directory structure:YourGame.app/Contents/MacOS/YourGame
YourGame.app/Contents/Resources/Content
When attempting to do something like using a custom font with a command such as this
Gum will look for that file path relative to the executable.
On Windows and Linux, this works fine since the
Contents
directory is relative to the executable, but for a macOS application bundle, theContent
directory is not relative to the executable. Instead, from the executable it is../Resources/Content
.MonoGame handles this in the
TitleContainer
automatically here by using a location value callledNSBundle.MainBundle.ResourcePath
https://github.com/MonoGame/MonoGame/blob/8ef655d5ca2c74e255aba2d93ea3a66a34ce6b07/MonoGame.Framework/Platform/TitleContainer.MacOS.cs#L20
This issue can be worked around by just simply placing the needed content files inside the
MacOS/
directory relative to the executable. There is no rule against doing this, but it is not the common practice or the recommended setup for application bundles.The text was updated successfully, but these errors were encountered: