Closed dashkal16 closed 6 years ago
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. I tested by writing a quick event dump to capture mouse events, then clicking in the lower-right corner.
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: https://github.com/StarChasers/OCGlasses/issues/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.
new event:
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.