Is there a way to detect when the screen's resolution changes?

So, I just found out yesterday that I can make jME’s window resizable in the AppSettings parameters. However, it doesn’t work pretty well, because it just scales the rendering frame. Because of that, the viewPort gets distorted and NiftyGUI too.

So, I wanna detect when the user changes screen’s resolution to “reset” the viewPort and stuff, and also to adjust the GUI(I’m making it responsive).

I’m thinking in creating an Interface for that, but is there already a way to find out when it changes resolution?

I can post pictures and even code only when I get home. Around ~6 hours.


You could attach a SceneProcessor to the main view port or the GUI view port. Each scene processor has a method

void reshape(ViewPort vp, int width, int height)

that you can override to detect resolution changes.


Thanks @Apollo, gonna test this when I can xD

1 Like