-
Notifications
You must be signed in to change notification settings - Fork 17
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Requesting a function to obtain the current viewport bounds #37
Comments
isn't the resolution static and content is scaled anyways? 512 x 288 if i figured that out correct (while these are float values, not pixels!) |
I was getting different values when I resized my game window and tested again. |
are you using some version <1.10.2? |
I am not: OpenGlasses-MC1.12.1-1.5.4.jar |
please take a look on this bug, that might help you to actually convert the position the event triggers to the internal resolution of openglasses. but note that this actually is a workaround and could change in future releases: #36 |
If that's the solution, then aside from needing the bounds (constants would be fine if the coords are to be fixed), that bug definitely needs a squash, because the mouse events for the overlay definitely vary with the screen size. |
@marcin212 i would suggest to expose the internal resolution of 512/288 to the lua backend. i would put it on my todo list if you agree with that. |
Much appreciated! I'll give that a poke next release :) |
It would be nice to have a way to obtain the 2d overlay bounds, so that UI can be scaled to the player's screen.
glasses.getOverlayBounds(user:string): number, number
Returns the maximal x and y coordinates for the given player.
This probably requires a client round-trip to actually query since the current screen size affects these values.
The text was updated successfully, but these errors were encountered: