Skip to content

Commit

Permalink
#2 changed button position
Browse files Browse the repository at this point in the history
  • Loading branch information
KOTerra committed Dec 30, 2022
1 parent 1927690 commit a091d95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.straferdeliberator.screens;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.kotcrab.vis.ui.VisUI;
import com.kotcrab.vis.ui.VisUI.SkinScale;
Expand All @@ -24,11 +23,14 @@ public class TitleScreen implements Screen {
public TitleScreen(Strafer game) {
this.game = game;

VisUI.load(SkinScale.X1);
VisUI.load(SkinScale.X2);

stage = new Stage(new ScreenViewport());

root.setFillParent(true);
root.pad(150);
root.defaults().space(20);
root.align(Align.right);
stage.addActor(root);

makeButtons();
Expand All @@ -39,17 +41,17 @@ public TitleScreen(Strafer game) {

private void makeButtons() {
VisTextButton loadGameButton = new VisTextButton("ia si joaca");
root.row();
root.add(loadGameButton);
loadGameButton.addListener(new ChangeListener() {

@Override
public void changed(ChangeEvent event, Actor actor) {
// Dialogs.showOKDialog(stage, "VisUI demo", "Everything is OK!");
showLoadGameMenu();
}
});

VisTextButton optionsButton = new VisTextButton("Optiones");
root.row();
root.add(optionsButton);
optionsButton.addListener(new ChangeListener() {

Expand All @@ -60,6 +62,7 @@ public void changed(ChangeEvent event, Actor actor) {
});

VisTextButton quitButton = new VisTextButton("Afara");
root.row();
root.add(quitButton);
quitButton.addListener(new ChangeListener() {

Expand All @@ -76,8 +79,7 @@ private void showLoadGameMenu() {
}

private void showSettingsMenu() {



}

@Override
Expand All @@ -98,27 +100,33 @@ public void dispose() {
stage.dispose();
}

/**
* changed to another screen
*/
@Override
public void hide() {
// TODO Auto-generated method stub

}

/**
* app out of focus or closed
*/
@Override
public void pause() {
// TODO Auto-generated method stub

}

/**
* app returned to focus
*/
@Override
public void resume() {
// TODO Auto-generated method stub

}

/**
* changed to this screen
*/
@Override
public void show() {
// TODO Auto-generated method stub

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] arg) {
//config.setDecorated(true);
config.setResizable(true);

//config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode() );
//config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
new Lwjgl3Application(new Strafer(), config);

}
Expand Down

0 comments on commit a091d95

Please sign in to comment.