The Wayback Machine - https://web.archive.org/web/20200707162231/https://github.com/bjorn/tiled/issues/2737
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WangId documentation is incorrect #2737

Open
Phlosioneer opened this issue Jan 27, 2020 · 1 comment
Open

WangId documentation is incorrect #2737

Phlosioneer opened this issue Jan 27, 2020 · 1 comment
Labels

Comments

@Phlosioneer
Copy link
Contributor

@Phlosioneer Phlosioneer commented Jan 27, 2020

The documentation says:

wangid: The Wang ID, which is a 32-bit unsigned integer stored in the format 0xCECECECE (where each C is a corner color and each E is an edge color, from right to left clockwise, starting with the top edge)

This is my test case:
testCase

The TSX output is:

<wangset name="test" tile="-1">
   <wangedgecolor name="" color="#ff0000" tile="-1" probability="1"/>
   <wangedgecolor name="" color="#00ff00" tile="-1" probability="1"/>
   <wangedgecolor name="" color="#0000ff" tile="-1" probability="1"/>
   <wangedgecolor name="" color="#ff7700" tile="-1" probability="1"/>
   <wangcornercolor name="" color="#ff0000" tile="-1" probability="1"/>
   <wangcornercolor name="" color="#00ff00" tile="-1" probability="1"/>
   <wangcornercolor name="" color="#0000ff" tile="-1" probability="1"/>
   <wangcornercolor name="" color="#ff7700" tile="-1" probability="1"/>
   <wangtile tileid="430" wangid="0x14433221"/>
  </wangset>

So it seems to be formatted 0xCECECECE, starting with the upper left corner, and going counter-clockwise. None of that lines up with any part of the documentation. Am I misreading the docs? Or misreading the test case?

@bjorn
Copy link
Owner

@bjorn bjorn commented Jan 27, 2020

The Wang ID, which is a 32-bit unsigned integer stored in the format 0xCECECECE (where each C is a corner color and each E is an edge color, from right to left clockwise, starting with the top edge)

It lines up if you consider the "starting with the top edge" to refer to the E on the right. I agree this is not exactly intuitive, so this should be made more explicit.

@bjorn bjorn added the documentation label Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.