Search in sources :

Example 1 with BadgesList

use of com.watabou.pixeldungeon.ui.BadgesList in project pixel-dungeon-remix by NYRDS.

the class BadgesScene method create.

@Override
public void create() {
    super.create();
    Music.INSTANCE.play(Assets.THEME, true);
    Music.INSTANCE.volume(1f);
    uiCamera.setVisible(false);
    int w = Camera.main.width;
    int h = Camera.main.height;
    Archs archs = new Archs();
    archs.setSize(w, h);
    add(archs);
    int pw = Math.min(160, w - 6);
    int ph = h - 30;
    NinePatch panel = Chrome.get(Chrome.Type.WINDOW);
    panel.size(pw, ph);
    panel.x = (w - pw) / 2;
    panel.y = (h - ph) / 2;
    add(panel);
    Text title = PixelScene.createText(TXT_TITLE, GuiProperties.titleFontSize());
    title.hardlight(Window.TITLE_COLOR);
    title.measure();
    title.x = align((w - title.width()) / 2);
    title.y = align((panel.y - title.baseLine()) / 2);
    add(title);
    Badges.loadGlobal();
    ScrollPane list = new BadgesList(true);
    add(list);
    list.setRect(panel.x + panel.marginLeft(), panel.y + panel.marginTop(), panel.innerWidth(), panel.innerHeight());
    ExitButton btnExit = new ExitButton();
    btnExit.setPos(Camera.main.width - btnExit.width(), 0);
    add(btnExit);
    fadeIn();
}
Also used : Archs(com.watabou.pixeldungeon.ui.Archs) ExitButton(com.watabou.pixeldungeon.ui.ExitButton) ScrollPane(com.watabou.pixeldungeon.ui.ScrollPane) NinePatch(com.watabou.noosa.NinePatch) BadgesList(com.watabou.pixeldungeon.ui.BadgesList) Text(com.watabou.noosa.Text)

Aggregations

NinePatch (com.watabou.noosa.NinePatch)1 Text (com.watabou.noosa.Text)1 Archs (com.watabou.pixeldungeon.ui.Archs)1 BadgesList (com.watabou.pixeldungeon.ui.BadgesList)1 ExitButton (com.watabou.pixeldungeon.ui.ExitButton)1 ScrollPane (com.watabou.pixeldungeon.ui.ScrollPane)1