@Override protected void layout() { super.layout(); bg.x = x; bg.y = y; bg.size(width, height); }
@Override protected void layout() { super.layout(); bg.x = x; bg.y = y; bg.size(width, height); slot.setRect(x + 2, y + 2, width - 4, height - 4); };
@Override protected void layout() { height = 32; shield.size(width, shield.height); avatar.x = PixelScene.align(camera(), shield.x + 15 - avatar.width / 2); avatar.y = PixelScene.align(camera(), shield.y + 16 - avatar.height / 2); compass.x = avatar.x + avatar.width / 2 - compass.origin.x; compass.y = avatar.y + avatar.height / 2 - compass.origin.y; hp.x = 30; hp.y = 3; depth.x = width - 24 - depth.width() - 18; depth.y = 6; keys.y = 6; danger.setPos(width - danger.width(), 18); buffs.setPos(31, 9); btnMenu.setPos(width - btnMenu.width(), 1); }
@Override public void update() { super.update(); if (visible && lightness > 0.5) { if ((lightness -= Game.elapsed) > 0.5) { bg.ra = bg.ga = bg.ba = 2 * lightness - 1; bg.rm = 2 * r * (1 - lightness); bg.gm = 2 * g * (1 - lightness); bg.bm = 2 * b * (1 - lightness); } else { bg.hardlight(r, g, b); } } }