RonenNess / GeonBit.UI

UI system for MonoGame projects.
MIT License
467 stars 63 forks source link

Extra steps for Linux necessary for Windows too #125

Open dclipca opened 2 years ago

dclipca commented 2 years ago

Is this expected for the latest version? I.e. had to perform both steps:


1. After installing the fonts from GeonBit.UI.Examples/Content/Fonts/, you also need to copy the font files into the folder where the spritefont files reside (e.g. Content/GeonBit.UI/themes/<team-name>/fonts/).
2. Since at this time MonoGame can't build effects on Linux, you need to use a pre-compiled effects. Take the built effects from Content/BuiltEffects/ and put them instead of the .fx files of your theme (e.g. Content/GeonBit.UI/themes/<team-name>/effects/). Also change their 'Build Action' from 'Build' to 'Copy'.
DavidFidge commented 2 years ago

For fonts on Windows I've found you don't have to 'install' the font. However the .ttf MUST be in the same directory as the .spritefont file (this became a requirement in one of the latest versions of MonoGame).

For effects, I have my Content.mgcb configured to build the effect file and in Visual Studio I have the build action set to "None" and "Do not copy":

begin GeonBit.UI/themes/mytheme/effects/disabled.fx

/importer:EffectImporter /processor:EffectProcessor /processorParam:DebugMode=Auto /build:GeonBit.UI/themes/mytheme/effects/disabled.fx

Be warned that GeonBit UI references MonoGame DesktopGL, so if you are using WindowsDX in your own project then you need to manually Git Clone GeonBit and change it to WindowsDX, then use a project reference rather than NuGet. If you don't do this then you get build errors saying that it could not compile the effect files. Refer to my answer at https://community.monogame.net/t/duplicate-solved-this-mgfx-effect-was-built-for-a-different-platform/11640.

RonenNess commented 2 years ago

Thanks for the info @DavidFidge , probably some things changed in latest MG versions.

DavidFidge commented 7 months ago

PR #139 addresses this by building content from the ttf directly rather than relying on installed fonts