Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - akasoor

#1
Help / UI text randomly changing sizes
April 26, 2024, 08:55:52 AM
I'm testing things before I make a mod and I have strange problem.

I'm trying to simply display text in upper-right corner of the screen. Code looks like that:
Rect labelRect = new Rect(UI.screenWidth - 200f, 20f, 190f, 30f);
Widgets.Label(labelRect, "Test text");

...and it works, text displays but have very inconsistent size (or style?), and this behaviour is somehow connected to position of a camera.
When camera is near center of the map, text displays in small font (similar to debug console text style), but when I move camera to any edge of the map, text changes style to bigger font (similar to temperature, time, weather style text).

I attached picture how this looks.
So what am I doing wrong in those two lines of code?