Page 1 of 1

To add own font to the game

Posted: Tue Oct 19, 2021 6:26 pm
by Adrian
Is it possible to add own font to the game?

I would like to make font more narrow and bigger. In Mission description.
Nearly as in old Dune, like this:

Image

Re: To add own font to the game

Posted: Tue Oct 19, 2021 10:06 pm
by abcdefg30
Fonts are referenced in the "Fonts:" section of "mod.yaml", so you can add a font there. You probably want to replace the existing fonts with your own font files. (Otherwise you then need to change the relevant "Font: <font name>" entries in the .yaml files inside the "chrome" directory. Which is doable but requires some more work.)

Re: To add own font to the game

Posted: Wed Oct 20, 2021 12:49 pm
by Adrian
Thank you very much!
It works. I want to do it more than a year :-)

Now I am still trying to understand about color of font.

Re: To add own font to the game

Posted: Thu Nov 14, 2024 5:38 pm
by Adrian
I would like to return here.
Some time ago (after discussion here) I made "Mission description".
First in bright yellow color.

Image

Later — in dark yellow color. It looks closer to old Dune.
(But bright yellow color is more readable)

Image

And just for information
(for myself too; another reserve copy):

color of font

tag TextColor in ... mods/d2k/chrome/missionbrowser.yaml

For example, bright yellow color
TextColor: EEE480

Re: To add own font to the game

Posted: Thu Nov 14, 2024 5:52 pm
by Adrian
And more complex question.
I would like to make caption (message output) in old Dune style. On the top of screen.
Like this. Big narrow red characters.

It looks like it needs compile cs files. I suppose I can.

Image

Re: To add own font to the game

Posted: Sat Nov 23, 2024 11:20 pm
by Adrian
Big narrow red characters.
I made it!
More details later, maybe.

The pictures below are cropped. So caption "Sietch structural integrity" is in the center in reality.
My caption is in the top left corner, as in old Dune2000.

More pixelated font:

Image

More smooth and readable font.
Which is better?
Image

Re: To add own font to the game

Posted: Mon Nov 25, 2024 9:36 pm
by Adrian
More details later, maybe.
This is slightly changed function SetMissionText().

UserInterface.SetMissionText() in lua.


I create another label (in the file ingame.yaml) with coordinates at top left corner.
Something like
Label@MOJ_TEXT (according to sample Label@MISSION_TEXT)

Then, in cs-file, I create new function SetMyText().

I use label there:
<LabelWidget>("MOJ_TEXT")

and make red color by default.

var c = color ?? Color.Red;

So, I can use the function in lua files now, for my messages.

Like this (red text, by default):
UserInterface.SetMyText("Fremen base detected to the Southeast")

Or green text, for example:
UserInterface.SetMyText("Fremen base detected to the Southeast", HSLColor.Green)

If somebody needs more details, I can write it.
When I will be next time in forum.