Commit 756707c1 authored by Fjen Undso's avatar Fjen Undso
Browse files

fix sprite scaling in menu and tutorial

parent a816d827
......@@ -31,23 +31,29 @@ public class MainMenuScreen implements Screen {
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/main-screen.png", Texture.class));
bg.setSize(wWidth, wHeight);
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
bg.setColor(Color.LIGHT_GRAY);
//generating player Buttons
p1_ready = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_ready_inactive.png", Texture.class));
p1_ready.setScale(scaleX, scaleY);
p1_ready.setCenter(wWidth / 2.0f, wHeight / 4.0f);
p2_ready = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_ready_inactive.png", Texture.class));
p2_ready.setScale(scaleX, scaleY);
p2_ready.setCenter(wWidth / 2.0f, wHeight / 4.0f * 3.0f);
p2_ready.rotate(180);
//generating QuestionmarkButtons
p1_quest = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_help.png", Texture.class));
p1_quest.setScale(scaleX, scaleY);
p1_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f - p1_quest.getHeight());
p2_quest = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_help.png", Texture.class));
p2_quest.setScale(scaleX, scaleY);
p2_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f * 3.0f + p2_quest.getHeight());
p2_quest.rotate(180);
......
......@@ -29,15 +29,19 @@ public class TutorialScreen implements Screen {
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/tutorial-screen.png", Texture.class));
bg.setSize(wWidth, wHeight);
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
bg.setColor(Color.LIGHT_GRAY);
//generating Close button#
closeBottom = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_back.png", Texture.class));
closeBottom.setScale(scaleX, scaleY);
closeBottom.setCenter(wWidth / 2.0f, closeBottom.getHeight() / 2.1f);
closeTop = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_back.png", Texture.class));
closeTop.setScale(scaleX, scaleY);
closeTop.setCenter(wWidth / 2.0f, wHeight - closeBottom.getHeight() / 2.1f);
closeTop.rotate(180);
}
......
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