trymnilsen / kingdomarchitect

Medieval simulation/city builder game for the browser.
https://kingdomarchitect.netlify.app
MIT License
13 stars 2 forks source link

Incorrect vertical uiText alignment #11

Open trymnilsen opened 1 year ago

trymnilsen commented 1 year ago

Seems like the measuring of the height of text is slightly of. This causes the alignment to not be centered.

Screenshot 2023-02-12 at 15 53 07
github-actions[bot] commented 4 weeks ago

Correct the y-offset

https://github.com/trymnilsen/kingdomarchitect/blob/b709b7e6d1bb27f0fd76d52b2a77856c4e0e10d6/ts/src/ui/view/uiText.ts#L103


                    this.screenPosition.x +
                    this._textAlignmentOffset.x +
                    this.padding.left,
                //TODO(#11): Correct the y-offset
                y:
                    this.screenPosition.y +
                    this._textAlignmentOffset.y +