Skip to content

Allow inline horizontal alignment of BBText#8390

Open
vanscheijen wants to merge 1 commit into4ian:masterfrom
vanscheijen:master
Open

Allow inline horizontal alignment of BBText#8390
vanscheijen wants to merge 1 commit into4ian:masterfrom
vanscheijen:master

Conversation

@vanscheijen
Copy link
Copy Markdown

The original pixi-multistyle-text seems to be archived, so I could not provide this patch upstream.

This patch will use the "align" style value of the first character of each line, to determine horizontal alignment per line.

This also fixes: https://forum.gdevelop.io/t/bbcode-allignment-does-not-work/75551

@vanscheijen vanscheijen requested a review from 4ian as a code owner March 14, 2026 20:55
@vanscheijen
Copy link
Copy Markdown
Author

This is the actual patch to the original (but unmaintained) codebase: tleunen/pixi-multistyle-text@cf96f8e

I've translated that patch to this compressed version, so the actual change (if you use a word-diff) is:

[-e,s=o[t];switch(this.withPrivateMembers()._style.align){case"left":e=d+c;break;case"center":e=d+c+(a-n[t])/2;break;case"right":e=d+c+a-n[t]}for(let-]

{+e,s=o[t];switch(s[0].style.align){case"left":e=d+c;break;case"center":e=d+c+(a-n[t])/2;break;case"right":e=d+c+a-n[t]}for(let+}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant