Skip to content

Label text word wrap #2458

Answered by eonarheim
TouwaStar asked this question in Q&A
Aug 11, 2022 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

@TouwaStar Thanks for the discussion thread! Currently there isn't anything built into Excalibur to handle text word wrap.

It's definitely something that would be a useful feature in Excalibur though! It is a tricky problem to solve for sure, I'll write up and issue around this so it can be supported 👍

A couple workarounds I can think of:

  1. The lo-fi: Manually manage the breaks and insert newline characters into your text\n and manually break into multiple lines.
  2. The hi-fi: Use an ex.Canvas object to manually draw text and use a canvas text library, this one https://github.com/geongeorge/canvas-txt looks pretty good and seems to work, example below:

// <script src="//unpkg.com/canvas-txt…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@TouwaStar
Comment options

@eonarheim
Comment options

@TouwaStar
Comment options

Answer selected by TouwaStar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@eonarheim
Comment options

@djcsdy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants