Expand format options for text object - especially outline
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
It can be quite difficult in some situations to make text readable on an arbitrary background. The usual way of solving this in games is to draw an _outline_ around the text – essentially, draw it twice, the first time slightly larger in a contrasting colour.
But text objects in Tiled only support very basic formats – colour, bold, italics, underline, and strike-through. All of those are great to have, but do nothing to help readability.
An expanded set of options could include:
* Outlines – you can specify the thickness and colour, so it's 2 new properties.
* Shadows – you can specify the offset and colour, so it's 3 new properties (or 2 if you added a "point" type).
* Generic fonts – set font to "serif" or "sans" to use a default system font. This might not be wanted very often, admittedly, but it could be nice to have for certain use-cases (I'm particularly thinking of non-videogame use-cases).
* Mirroring – draw text backwards or upside down.
* Background – you can treat the text as existing in a rectangle which, by default, is fully transparent, but it could be made non-transparent – assign colour, margins, border colour, border thickness, maybe even corner rounding. Actually, most of this might be better handled as new options on the shape objects, but also add an object property on text objects that can be used to link the text's size and position with that of its background. Then the other object could possibly even be a tile object for a nice fancy background (though you'd probably want 9-slice support if you were going to do this). Margins would still be a text property though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
This issue is a broad proposal covering outlines, shadows, fonts, mirroring, and backgrounds, but it names no files, tests, or entry points. First narrow the work to one formatting option and identify the text-object rendering path; done should include a defined property set, rendering behavior, and tests for the selected option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100