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

screen.drawTextBox() horizontal alignment parameter does not reflect in-game result #115

Open
linmar22 opened this issue Mar 20, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@linmar22
Copy link

What I expected to happen
Using screen.drawTextBox() in the VSC plugin produces results as they would be in-game.

What happened instead
When aligned right, the horizontal alignment parameter places the text in reference to it's left side, and not the right.

How do I reproduce this?
Reliable steps that should produce this issue:

  1. screen.drawText(0, 0, screen.GetWidth(), 10, "my text", 1, 0) in the plugin and in the game
  2. Observe differences.
@linmar22 linmar22 added the bug Something isn't working label Mar 20, 2023
@nameouschangey
Copy link
Owner

Thanks for raising this, I'm afraid I'm extremely time limited these days.
Could you provide screenshots of the difference - as I don't have the game installed anymore.
Also, it may be worth looking at forking + fixing this yourself, then bringing it back in via pull-request - if this is important for the work you're doing.

Many Thanks

@linmar22
Copy link
Author

Sure here it is...

In-game vs In-Sim

Notice how the bottom-right text value is aligned based on the first character of the string in the sim, but on the last character in the game.

I think in-game the position is actually calculated based on the width of the rendered string, since if you horizontally center the text, it can sit between the screen pixel-grid locations.

The bug isn't a big deal for me personally, just stood out a bit when I encountered it.

@nameouschangey
Copy link
Owner

Perfect, thanks!

Can't make any promises about me fixing it - but if not me, hopefully somebody else will.
Many thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants