public void enable( boolean value ) { active = value; text.alpha( value ? 1.0f : 0.3f ); }
private void enable( boolean value ) { enabled = value; if (icon != null) { icon.alpha( value ? ENABLED : DISABLED ); } if (number != null) { number.alpha( value ? ENABLED : DISABLED ); } }
@Override public void update() { super.update(); if (visible) { time -= Game.elapsed; if (time > 0) { tf.alpha( time > TIME / 2 ? 1f : time * 2 / TIME ); } else { visible = false; } } if (Dungeon.gold != lastValue) { lastValue = Dungeon.gold; tf.text( Integer.toString( lastValue ) ); tf.measure(); visible = true; time = TIME; layout(); } } }
@Override public void update() { super.update(); if (visible) { time -= Game.elapsed; if (time > 0) { tf.alpha( time > TIME / 2 ? 1f : time * 2 / TIME ); } else { visible = false; } } if (Dungeon.gold != lastValue) { lastValue = Dungeon.gold; tf.text( Integer.toString( lastValue ) ); tf.measure(); visible = true; time = TIME; layout(); } } }
@Override public void update() { super.update(); if (visible) { time -= Game.elapsed; if (time > 0) { tf.alpha( time > TIME / 2 ? 1f : time * 2 / TIME ); } else { visible = false; } } if (Dungeon.gold != lastValue) { lastValue = Dungeon.gold; tf.text( Integer.toString( lastValue ) ); tf.measure(); visible = true; time = TIME; layout(); } } }
@Override protected void layout() { panel.x = this.x; panel.y = this.y; panel.alpha(alpha); panel.visible = updateAvailable || !quiet; updateMessage.x = panel.x+panel.marginLeft(); updateMessage.y = panel.y+panel.marginTop(); updateMessage.measure(); updateMessage.alpha(alpha); updateMessage.visible = updateAvailable || !quiet; panel.size( panel.marginHor()+updateMessage.width(), panel.marginVer()+updateMessage.height()-1); this.width = panel.width(); this.height = panel.height(); }
health.x = PixelScene.align( 53.0f - health.width() / 2 ); health.y = PixelScene.align( 4.0f - health.baseLine() / 2 ); health.alpha( 0.5f );
version.alpha( 0.5f ); add(version);
version.alpha( 0.5f ); add(version);