@Override public void draw(Batch batch, float parentAlpha) { Color fontColor; if (isDisabled() && style.disabledFontColor != null) fontColor = style.disabledFontColor; else if (isPressed() && style.downFontColor != null) fontColor = style.downFontColor; else if (isChecked() && style.checkedFontColor != null) fontColor = (isOver() && style.checkedOverFontColor != null) ? style.checkedOverFontColor : style.checkedFontColor; else if (isOver() && style.overFontColor != null) fontColor = style.overFontColor; else fontColor = style.fontColor; if (fontColor != null) label.getStyle().fontColor = fontColor; if (isDisabled()) shortcutLabel.getStyle().fontColor = style.disabledFontColor; else shortcutLabel.getStyle().fontColor = shortcutLabelColor; if (image != null && generateDisabledImage) { if (isDisabled()) image.setColor(Color.GRAY); else image.setColor(Color.WHITE); } super.draw(batch, parentAlpha); }
public void pintar(SpriteBatch batch, float parentAlpha, ScreenViewport vista) { if (estado_juego == ESTADO_NORMAL) { time += Gdx.graphics.getDeltaTime(); estado.draw(); batch2.begin(); fuente.draw(batch2, "" + (int) time, 220, 480); batch2.end(); } else if (estado_juego == ESTADO_GANA) { final int tiempo = (int) time; batch.begin(); // fuente.draw(batch2, "Ganaste", 320/2,480/2); gana.draw(batch, 1); replay.draw(batch, 1); menu.draw(batch, 1); next.draw(batch, 1); if (tiempo >= 0 && tiempo <= 10) { batch.draw( Recursos.getRecursos().getCuadroColor("amarrillo"), (qbox.Pantalla.ANCHO / 2) - 128, (qbox.Pantalla.ALTO / 2) - 180); batch.draw( Recursos.getRecursos().getCuadroColor("azul"), (qbox.Pantalla.ANCHO / 2) - 52, (qbox.Pantalla.ALTO / 2) - 180); batch.draw( Recursos.getRecursos().getCuadroColor("rojo"), (qbox.Pantalla.ANCHO / 2) + 25, (qbox.Pantalla.ALTO / 2) - 180); } else if (tiempo > 10 && tiempo <= 20) { batch.draw( Recursos.getRecursos().getCuadroColor("amarrillo"), (qbox.Pantalla.ANCHO / 2) - 128, (qbox.Pantalla.ALTO / 2) - 180); batch.draw( Recursos.getRecursos().getCuadroColor("azul"), (qbox.Pantalla.ANCHO / 2) - 52, (qbox.Pantalla.ALTO / 2) - 180); } else if (tiempo > 20 && tiempo <= 30) { batch.draw( Recursos.getRecursos().getCuadroColor("amarrillo"), (qbox.Pantalla.ANCHO / 2) - 52, (qbox.Pantalla.ALTO / 2) - 180); } batch.end(); } else if (estado_juego == ESTADO_PIERDE) { batch.begin(); pierde.draw(batch, 1); replay.draw(batch, 1); menu.draw(batch, 1); batch.end(); } }