GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Default text object colour to black like Tiled by vtxe02023274 · Pull Request #191 · fallahn/tmxlite

Conversation

@vtxe02023274

@vtxe02023274 vtxe02023274 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Text objects with the default colour load as white.

Tiled only writes color on <text> when it isn't black (mapwriter.cpp), and the TMX docs give the default as #000000. parseText fell back to #FFFFFFFF, so a plain text object made in Tiled came back as RGBA: 255, 255, 255, 255.

The fallback is now #000000, which is also what Text::colour defaults to and what parseTemplate compares against when deciding whether to take the template's colour.

Added ParseTest/maps/text.tmx and testTextObjects() (default, #ff0000, #8000ff00). Before the change it fails on the first object:

FAIL: objects[0].getText().colour = tmx::Colour(0, 0, 0, 255)
  Left:  RGBA: 255, 255, 255, 255
  Right: RGBA: 0, 0, 0, 255

After, all checks pass and the rest of the ParseTest output is unchanged (GCC 11, ASan/UBSan clean).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vtxe02023274
default text object colour to black like Tiled
1f500f7
Tiled omits the color attribute of <text> when the colour is black, so a missing attribute must read as black, not white. This also matches the Text struct default that parseTemplate compares against.
@fallahn
fallahn merged commit 088e434 into fallahn:master Nov 25, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vtxe02023274 @fallahn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.