citadel icon indicating copy to clipboard operation
citadel copied to clipboard

Center the text of the mana counter.

Open ghost opened this issue 6 years ago • 4 comments

This centers the mana counter text at my 13" laptop (1152x648) by pushing it a little bit upwards.

 where before this after this
1152x648 screen shot 2018-05-12 at 23 39 47 screen shot 2018-05-12 at 23 34 29
1280x720 screen shot 2018-05-12 at 23 38 30 screen shot 2018-05-12 at 23 35 26

I'll check larger resolutions before adding the change.

ghost avatar May 12 '18 21:05 ghost

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 screenshot_20180516_132413 screenshot_20180516_132915
16:9 1600x900 screenshot_20180516_132657 screenshot_20180516_132808
16:10 1600x1000 screenshot_20180516_140044 screenshot_20180516_140058 screenshot_20180516_135830 screenshot_20180516_135845
3:2 1500x1000 screenshot_20180516_135354 screenshot_20180516_135410 screenshot_20180516_135611 screenshot_20180516_135625
4:3 1333x1000 screenshot_20180516_135025 screenshot_20180516_135041 screenshot_20180516_134730 screenshot_20180516_134743
  • 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.

ghost avatar May 16 '18 16:05 ghost

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.

HarryMichal avatar Mar 14 '19 22:03 HarryMichal

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.

ghost avatar Mar 16 '19 18:03 ghost

Ok.

HarryMichal avatar Mar 17 '19 12:03 HarryMichal