use of eidolons.libgdx.gui.generic.btn.TextButtonX in project Eidolons by IDemiurge.
the class MapTimePanel method init.
public void init() {
setSize((355), (203));
speedUpBtn = new TextButtonX("", STD_BUTTON.SPEED_UP, () -> {
MacroGame.getGame().getLoop().getTimeMaster().speedUp();
});
speedDownBtn = new TextButtonX("", STD_BUTTON.SPEED_DOWN, () -> {
MacroGame.getGame().getLoop().getTimeMaster().speedDown();
});
pauseButton = new TextButtonX("", STD_BUTTON.PAUSE, () -> {
MacroGame.getGame().getLoop().togglePaused();
MacroGame.getGame().getLoop().getTimeMaster().resetSpeed();
});
float moonSize = GdxMaster.adjustSize(SIZE);
addListener(new DynamicTooltip(() -> getDateString()).getController());
// display DatePanel?
for (MOON moon : MOON.values()) {
MoonActor container = new MoonActor(moon);
moonMap.put(moon, container);
}
float sunSize = moonSize * 2f;
sun = new SunActor(false);
sun.setSize(sunSize, sunSize);
sun.setVisible(false);
undersun = new SunActor(true);
undersun.setSize(sunSize, sunSize);
undersun.setVisible(false);
timeLabel = new Label("", StyleHolder.getSizedLabelStyle(FONT.NYALA, 18));
addActor(weave);
addActor(mainCircle);
addActor(sun);
addActor(undersun);
addActor(labelBg = new Image(TextureCache.getOrCreateR(getPath() + "label bg.png")));
addActor(pauseButton);
addActor(speedUpBtn);
addActor(speedDownBtn);
addActor(timeLabel);
initPositions();
GuiEventManager.bind(MapEvent.TIME_CHANGED, p -> {
update((DAY_TIME) p.get());
});
sun.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
MacroGame.getGame().getLoop().getTimeMaster().newMonth();
return super.touchDown(event, x, y, pointer, button);
}
});
undersun.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
MacroGame.getGame().getLoop().getTimeMaster().newMonth();
return super.touchDown(event, x, y, pointer, button);
}
});
// adjustSizes();
}
Aggregations