RonenNess / GeonBit.UI

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

is UI Scale doubled by default? #96

Closed philosaur closed 5 years ago

philosaur commented 5 years ago

Why are all textures rendered at 200% size by default?

With GlobalScale set to 1, everything is rendered at 200%. At .5, everything is rendered pixel-for-pixel, which is what I want. But at .5, fonts are rendered poorly--even if I double the font size in the spritefont file. Plus, I don't want to have to double all pixel measurements when laying out my UI.

Is there other global scaling thing I'm missing?

(I've looked through both open and closed issues and didn't see anything about this.)

RonenNess commented 5 years ago

Hi @philosaur,

That's probably due to theme properties. For example, take a look at this file:

https://github.com/RonenNess/GeonBit.UI/blob/master/GeonBit.UI/Content/GeonBit.UI/themes/hd/styles/Panel-Default.xml#L4

The scale property embedded in the stylesheet will affect the entity before applying the global scale. The built-in themes are 8-bit style so have natural scaling (although admittedly 2.2 is a terrible number, should have been 2).

You can play with the style file to get natural pixel-for-pixel look and then control it via scale, but note that it will change some ratios between fonts and frames.

Hope this answer your question! :)