Skip to content

Expand format options for text object - especially outline #4447

Description

@CelticMinstrel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions