Missing multiline text display widget
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Millennium Duel |
In Progress
|
Medium
|
Adam Malinowski |
Bug Description
With the WLabel, we can display text and information as we wish, but as long as it contains just one line.
In many cases we will want to use multiline text. This includes on-card and off-card effect description and favour text, list of authors, complex dialogs.
Therefore a widget that can display multiline text is a must.
This will be tricky with allegro. That is because allegro supports no multiline features.
So we would need to implement following features on our own:
1. Line wrapping.
2. Predicting width of multiline text (nonwrapped)
3. Predicting height of multiline text (possibly wrapped, alligned to a given width)
4. Drawing multiline text (possibly alligned to given width)
5. Drawing justified multiline text.
That requires lots of splitting text to words, measuring them separately etc.
Luckily, I have found an example code that accomplishes that. This issue is discussed in this forum thread [1], 9th post (8th reply) provides an attachment [2] that does exactly what we need in a very cohesive way.
I doubt we can re-use this code, though. However, we certainly can read, learn, and recreate features we need.
[1]: https:/
[2]: https:/
Related branches
Changed in millenniumduel: | |
assignee: | nobody → Przemysław Wawrzyniak (przem-wawrzyniak) |
Changed in millenniumduel: | |
assignee: | Przemysław Wawrzyniak (przem-wawrzyniak) → nobody |
Changed in millenniumduel: | |
milestone: | 0.1 → 0.2 |
Changed in millenniumduel: | |
assignee: | nobody → Adam Malinowski (adayah) |
status: | Triaged → In Progress |
I have merged in your branch that introduced basic support of this widget, as it seemed pretty usable, and I really needed multiline text immediately - no point in writing my own since yours seems to work great so far.
You are welcome to continue your work on it if you feel it's not complete, and therefore I will NOT mark this bug as solved unless I know such is your wish.