private final void setLocationButtonDefault() { newPart.setBoundsGL( new RectangleDouble( -(BUTTON_WIDTH / 2), posNewPart + (BUTTON_HEIGHT / 2), (BUTTON_WIDTH / 2), posNewPart - (BUTTON_HEIGHT / 2))); loadPart.setBoundsGL( new RectangleDouble( -(BUTTON_WIDTH / 2), posLoadPart + (BUTTON_HEIGHT / 2), (BUTTON_WIDTH / 2), posLoadPart - (BUTTON_HEIGHT / 2))); }
@Override public GuiActionEvent processLogic() { if (getState() != VISIBLE) { return super.processLogic(); } if (newPart.processLogic() == GuiActionEvent.CLICK_EVENT) { nextPanel(new ScreenNewGame()); } if (loadPart.processLogic() == GuiActionEvent.CLICK_EVENT) { nextPanel(new ScreenLoadMenu()); } return GuiActionEvent.NULL_EVENT; }
@Override protected void drawComponentAppearing(Painter painter) { switch (appearSelector) { case FIRST_APPEARING: TextureQuad tex1 = TexturesLoader.getQuad( String.format(GameRessources.SPEC_PATH_TERRAIN, 1) + GameRessources.TEX_SOL); float colorUnit = (float) ((double) getAppearCount() / timeToAppear() * 0.5); Color4f color = new Color4f(colorUnit, colorUnit, colorUnit); Color4f buttonColor = new Color4f(colorUnit * 2, colorUnit * 2, colorUnit * 2); painter.setColor(color); tex1.fillScreen2D(0.5, 0.5, true, painter); drawTitleImage(painter, buttonColor); newPart.setColor(buttonColor); loadPart.setColor(buttonColor); break; default: super.drawComponentAppearing(painter); } }