Commit 906e8732 authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

Drew resized board

parent 7ead50a5
......@@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
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.utils.Scaling;
import com.mygdx.game.controllers.PlayerController;
import com.mygdx.game.views.enums.PlayAssets;
import com.mygdx.game.views.tokens.AnimatedSprite;
......@@ -37,7 +38,12 @@ public class PlayView extends View{
super(gvm, playerController, assetManager, stage, skin);
background = new Texture("Game/1x/GameBoard@1x.png");
this.backgroundImage = new Image(background);
backgroundImage.setPosition(col_width * 6 - backgroundImage.getWidth() / 2, row_height * 6 - backgroundImage.getHeight() / 2);
backgroundImage.setScaleX(0.25F);
backgroundImage.setScaleY(0.25F);
backgroundImage.setScaling(Scaling.fill);
backgroundImage.setPosition(Gdx.graphics.getWidth() / 2F - backgroundImage.getWidth() * backgroundImage.getScaleX() / 2F, Gdx.graphics.getHeight() / 2F - backgroundImage.getHeight() * backgroundImage.getScaleY() / 2F);
stage.addActor(backgroundImage);
for (PlayAssets asset : PlayAssets.values()) {
......@@ -71,7 +77,8 @@ public class PlayView extends View{
int x = Gdx.input.getX() - (Gdx.graphics.getWidth() / 2);
int y = Gdx.input.getY() - (Gdx.graphics.getHeight() / 2);
System.out.println(x + ", " + y);
System.out.println("Midtstilt: " + x + ", " + y);
System.out.println("Vanlig: " + Gdx.input.getX());
}
}
......@@ -85,7 +92,7 @@ public class PlayView extends View{
public void render(float dt) {
stage.getBatch().begin();
stage.getBatch().draw(background, 0, 0);
//stage.getBatch().draw(background, 0, 0);
stage.getBatch().end();
stage.draw();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment