Open ghost opened 6 years ago
I was hoping this would be easy, but now I'm not so sure.
Pics using larger resolutions:
ratio | where | before this | after this |
---|---|---|---|
16:9 | 1080x607 | ||
16:9 | 1600x900 | ||
16:10 | 1600x1000 | ||
3:2 | 1500x1000 | ||
4:3 | 1333x1000 |
Running 1333x1000 this proposed alignment would result not in a centering, but end up mis aligning the text too much upwards.
Larger resolutions, if using uncommon (but expectable) ratios, seem slightly affected of the scaling issue https://github.com/davewx7/citadel/issues/192 (that issue was presented originally using a rather extreme resolution, but actual use case).
Even after getting a stable font size (by fixing https://github.com/davewx7/citadel/issues/192), consider using a smaller font when mana >=10 is to be displayed, probably using some of cairo#markup_text(...)
(https://github.com/anura-engine/anura/blob/6c709c01b368e1797346039c4eeb13f0ea35707a/src/cairo.cpp#L2048), cairo#layout_text(...)
(https://github.com/anura-engine/anura/blob/6c709c01b368e1797346039c4eeb13f0ea35707a/src/cairo.cpp#L2125), cairo#font_extents(...)
(https://github.com/anura-engine/anura/blob/6c709c01b368e1797346039c4eeb13f0ea35707a/src/cairo.cpp#L2197), or cairo#text_extents(...)
(https://github.com/anura-engine/anura/blob/6c709c01b368e1797346039c4eeb13f0ea35707a/src/cairo.cpp#L2218).
I shall have this on hold, fix https://github.com/davewx7/citadel/issues/192, and then get back to this.
The problem itself is solved here -> the mana counter IS centered with this PR. The problem with mana counter overflowing the art should be addressed with a separate PR.
The problem itself is solved here -> the mana counter IS centered with this PR. [...]
No. The mana counter is not centered with this PR, because we can not really center any text if that text is affected of scaling issues.
Scaling issues affect every resolution. #192 is only an extreme example of how bad this problem can manifest in case the game runs fullscreen on a 16:10 display configured in a vertical setup.
That's a rare use one could say. But is something not so hard or expensive to do nowadays. Using the fantastic DELL™ U2415 the frame is so thin (excepting the bottom part of course and only) you can make a nice 2400x1920 5:4 setup using two.
[...] The problem with mana counter overflowing the art should be addressed with a separate PR.
In case anyone declares that such thing is a problem to be solved.
Ok.
This centers the mana counter text at my 13" laptop (1152x648) by pushing it a little bit upwards.
I'll check larger resolutions before adding the change.