use of gaiasky.util.TipGenerator in project gaiasky by langurmonkey.
the class LoadingGui method initialize.
@Override
public void initialize(AssetManager assetManager, SpriteBatch sb) {
interfaces = new Array<>();
float pad30 = 48f;
float pad10 = 16f;
final Settings settings = Settings.settings;
// User interface
ScreenViewport vp = new ScreenViewport();
vp.setUnitsPerPixel(unitsPerPixel);
ui = new Stage(vp, sb);
if (vr) {
vp.update(settings.graphics.backBufferResolution[0], settings.graphics.backBufferResolution[1], true);
} else {
vp.update(GaiaSky.instance.graphics.getWidth(), GaiaSky.instance.graphics.getHeight(), true);
}
center = new Table(skin);
if (!vr) {
Texture tex = new Texture(Gdx.files.internal("img/splash/splash.jpg"));
Drawable bg = new SpriteDrawable(new Sprite(tex));
center.setBackground(bg);
}
center.setFillParent(true);
center.center();
if (hoffset > 0)
center.padLeft(hoffset);
else if (hoffset < 0)
center.padRight(-hoffset);
HorizontalGroup titleGroup = new HorizontalGroup();
titleGroup.space(pad30 * 2f);
OwnLabel gaiaSky = new OwnLabel(Settings.getApplicationTitle(settings.runtime.openVr), skin, "main-title");
OwnLabel version = new OwnLabel(Settings.settings.version.version, skin, "main-title");
version.setColor(skin.getColor("theme"));
titleGroup.addActor(gaiaSky);
titleGroup.addActor(version);
// Funny text
lastFunnyTime = 0;
i = -1;
m1 = BigInteger.ZERO;
m2 = BigInteger.ZERO;
spin = new OwnLabel("0", skin, "main-title-xs");
spin.setColor(skin.getColor("theme"));
center.add(titleGroup).center().padBottom(pad10 * 2f).row();
center.add(spin).padBottom(pad30).row();
// Tips
tipGenerator = new TipGenerator(skin);
tip = new HorizontalGroup();
tip.space(pad10);
bottomMiddle = new Table(skin);
bottomMiddle.setFillParent(true);
bottomMiddle.center().bottom();
bottomMiddle.padLeft(pad30).padBottom(pad10);
bottomMiddle.add(tip);
// Version and build
topLeft = new VersionLineTable(skin);
// SCREEN MODE BUTTON - TOP RIGHT
screenMode = new Table(skin);
screenMode.setFillParent(true);
screenMode.top().right();
screenMode.pad(pad10);
OwnTextIconButton screenModeButton = new OwnTextIconButton("", skin, "screen-mode");
screenModeButton.addListener(event -> {
if (event instanceof ChangeEvent) {
settings.graphics.fullScreen.active = !settings.graphics.fullScreen.active;
EventManager.publish(Event.SCREEN_MODE_CMD, screenModeButton);
return true;
}
return false;
});
screenMode.add(screenModeButton);
// MESSAGE INTERFACE - BOTTOM
notificationsInterface = new NotificationsInterface(skin, lock, false, false, false);
center.add(notificationsInterface);
interfaces.add(notificationsInterface);
rebuildGui();
}
Aggregations