I’ve been trying to use the layers system to keep things right on a panel rotation in the guiNode. However, it didn’t work until I added the comparators to the gui viewport. The GuiGlobals
constructor adds the layer comparator for the Gui Bucket in the main viewport instead of the gui viewport.
protected GuiGlobals( Application app ) {
...........
ViewPort main = app.getViewPort();
setupGuiComparators(main);
}
....
public void setupGuiComparators( ViewPort view ) {
RenderQueue rq = view.getQueue();
rq.setGeometryComparator(Bucket.Opaque,
new LayerComparator(rq.getGeometryComparator(Bucket.Opaque), -1));
rq.setGeometryComparator(Bucket.Transparent,
new LayerComparator(rq.getGeometryComparator(Bucket.Transparent), -1));
rq.setGeometryComparator(Bucket.Gui,
new LayerComparator(rq.getGeometryComparator(Bucket.Gui), -1));
}
Adding it to the gui viewport instead seems to solve the problem.