Hi all, I’m making a map game set in the cold war and am wondering how to create labels for countries similar to the ones in HOI4:

My question is, how do I:
a) Find the largest possible text size/width of text that fits in a territory’s area2D, taking into account the length of the name (e.g. “Canada” vs “German Democratic Republic”)
b) Create a label that spans this width with the correct position, angle, margins/padding, etc.
c) Change the size of the label dynamically when countries gain or lose territory
Also note that, since some countries have empires (see UK, France…) or faraway territories (see U.S. with Alaska), and some are island nations (see Indonesia) there can also be multiple collision shapes rather than only one. Maybe a label could be created for each collision shape as long as it’s not a tenny tiny island?
Also, a bit off-topic, but I got a pause screen working! Hooray!


I was looking for something similar and found an asset in the godot asset library called Font Auto Size Labels. (https://godotengine.org/asset-library/asset/2866) It only worked well at design time and not runtime so I abandoned the idea and stuck with regular labels and using elipses. But I bet if you examine how the asset works, you might be able to get it function at runtime or learn how it works and roll your own. Good luck!