Skip to content
Snippets Groups Projects
Commit fef78ec8 authored by Olivia Foshaug Ingvaldsen's avatar Olivia Foshaug Ingvaldsen
Browse files

Change exit button

parent ffd5eaed
Branches
No related tags found
No related merge requests found
Pipeline #218882 failed
......@@ -5,6 +5,7 @@ import com.badlogic.gdx.ScreenAdapter
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.GL20
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.scenes.scene2d.InputEvent
import com.badlogic.gdx.scenes.scene2d.Stage
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton
......@@ -38,7 +39,11 @@ class GameScreen(private val game: Netrunner, private val controller: GameContro
buttonStyle.font = game.skin.getFont("default-font")
buttonStyle.downFontColor = Color.RED
val exitButton = TextButton("Exit", buttonStyle) //bruk evt. game.skin
val exitButton = ImageButton(TextureRegionDrawable(TextureRepository.exitButton)) //bruk evt. game.skin
exitButton.apply {
width = 70f
height = 70f
}
//if we want an exact position
//exitButton.setPosition(1000f, 10f)
// stage.addActor(exitButton)
......@@ -69,7 +74,9 @@ class GameScreen(private val game: Netrunner, private val controller: GameContro
val table = Table()
table.setFillParent(true)
table.row()
table.add(exitButton).pad(50f).expand().top().right()
table.add(exitButton).pad(30f).expand().top().right()
.width(exitButton.width)
.height(exitButton.height)
table.row()
stage.addActor(table)
......
......@@ -26,6 +26,7 @@ object TextureRepository {
val upButton = Texture(Gdx.files.internal("ui_up.png"))
val downButton = Texture(Gdx.files.internal("ui_down.png"))
val exitButton = Texture(Gdx.files.internal("ui_exit.png"))
init {
for (color in PlayerColor.values()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment