Modding: Text size from MapComponent changes depending on map panning

Started by ChJees, May 16, 2017, 08:29:53 AM

Previous topic - Next topic

ChJees

Interesting quirk i discovered with text in a MapComponent when drawn using its MapComponentOnGUI() function.

The text change in size when you pan the map up and down. Probably is some weirdness in the GUI state going on doing that.

Code (C#) Select
public override void MapComponentOnGUI()
{
    Widgets.Label(new Rect(32,32, 256, 32), "Thrush Cells = " + thrushCells.Count);
}


https://dl.dropboxusercontent.com/u/547140/Rimworld/SmallText.jpg
https://dl.dropboxusercontent.com/u/547140/Rimworld/BigText.jpg

ZorbaTHut

Working-as-designed. I imagine you're panning over something that changes font size; there's no guaranteed setting when it enters MapComponentOnGUI(), you're intended to always set it yourself.