Skip to content

Commit

Permalink
Buttons update
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaganx0 committed Oct 7, 2023
1 parent 5e8ecb0 commit bdbd074
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.csse3200.game.GdxGame;

Expand Down Expand Up @@ -54,7 +54,9 @@ public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, f
}
});

TextButton GameDescButton = new TextButton("GameDesc", skin);
Texture imageTexture = new Texture("images/ui/Sprites/UI_Glass_Arrow_Large_01a.png");
Drawable drawable = new TextureRegionDrawable(new TextureRegion(imageTexture));
ImageButton GameDescButton = new ImageButton(drawable);
GameDescButton.addListener(new ClickListener() {
@Override
public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.csse3200.game.GdxGame;

Expand Down Expand Up @@ -44,7 +47,9 @@ public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, f
}
});

TextButton MobsButton = new TextButton("Mobs", skin);
Texture imageTexture = new Texture("images/ui/Sprites/UI_Glass_Arrow_Large_01a.png");
Drawable drawable = new TextureRegionDrawable(new TextureRegion(imageTexture));
ImageButton MobsButton = new ImageButton(drawable);
MobsButton.addListener(new ClickListener() {
public void clicked(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y) {
game.setScreen(GdxGame.ScreenType.HELP_MOBS_SCREEN);
Expand Down

0 comments on commit bdbd074

Please sign in to comment.