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

ANCHOR_ constants treat the screen as vertically stretched #1376

Closed
Narre opened this issue Apr 13, 2020 · 4 comments · Fixed by #1815
Closed

ANCHOR_ constants treat the screen as vertically stretched #1376

Narre opened this issue Apr 13, 2020 · 4 comments · Fixed by #1815

Comments

@Narre
Copy link
Contributor

Narre commented Apr 13, 2020

SuperTux version: recent git version (commit 99f72fb), but it does the same in 0.6.1.1
System information: Ubuntu 19.10 64bit

Actual behaviour:
When setting the anchor point of Text (and maybe also floating images, but I haven't tested that), the ANCHOR_ constants anchor the text in the wrong position as if the screen was stretched vertically. TOP_LEFT, TOP and TOP_RIGHT work fine, but MIDDLE_LEFT, MIDDLE and MIDDLE_RIGHT put the text in the bottom half of the screen and BOTTOM_LEFT, BOTTOM and BOTTOM_RIGHT put it under the screen completely, so it can't be seen.

Expected behaviour:
MIDDLE should anchor the text in the middle and BOTTOM should put it at the bottom of the screen, not underneath it.

Video:
https://youtu.be/zHvzNWYR2Nw

@Narre Narre changed the title ANCHOR_ constants treat the screen as a square ANCHOR_ constants treat the screen as if it were vertically stretched Apr 13, 2020
@Narre Narre changed the title ANCHOR_ constants treat the screen as if it were vertically stretched ANCHOR_ constants treat the screen as vertically stretched Apr 13, 2020
@Zwatotem
Copy link
Member

At first glance looks like anchor points are relative to level, not to screen.

@Narre
Copy link
Contributor Author

Narre commented Apr 14, 2020

That's not the case. ANCHOR_BOTTOM puts the text under the screen even when Tux is at the very bottom of the level. The position in the level has no effect, the text always shows in the same position relative to the screen.

@tobbi
Copy link
Member

tobbi commented Aug 29, 2020

If the coordinate system starts in the top left, and ANCHOR_BOTTOM is selected, then naturally, it'll draw the text below the screen. Not sure if this is expected behaviour.

@Narre
Copy link
Contributor Author

Narre commented Sep 3, 2020

I'm 100% sure this worked the way I expected it to in older versions. I came across this when some text didn't show up in one of my older levels, whereas in the older version (which, I think, was 0.4.x), the text was shown at the bottom as it should be. So something must have changed between versions, and I don't think it was on purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants