Commit d3b23770 authored by Fjen Undso's avatar Fjen Undso
Browse files

add background overlays

parent 3a80b83f
......@@ -51,7 +51,8 @@ public class GameScreen implements Screen {
Map<Hexagon, Bubble> nachbarn;
ShapeRenderer renderer = new ShapeRenderer();
float bound = 0;
Sprite bg;
Sprite bg, bgOverlay;
Sprite next;
Vector2 mapoffset;
private Rectangle m_Bounds;
float wWidth, wHeight;
......@@ -81,12 +82,19 @@ public class GameScreen implements Screen {
bg.setScale(scaleX, scaleY);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
bgOverlay = new Sprite(FrozenNumbersGame.assets.get("sprites/game-border.png", Texture.class));
bgOverlay.setScale(scaleX, scaleY);
bgOverlay.setCenter(wWidth / 2.0f, wHeight / 2.0f);
next = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_next.png", Texture.class));
next.setScale(scaleX, scaleY);
next.setCenter(wWidth / 4.0f, wHeight * 0.05f);
hexbulder.setGridHeight(15);
hexbulder.setGridWidth(11);
hexbulder.setRadius(bubblradius);
hexbulder.setOrientation(HexagonOrientation.FLAT_TOP);
map = hexbulder.build();
Hexagon test = map.getByPixelCoordinate(wWidth / 2.0f, wHeight / 2.0f);
mapoffset = new Vector2(0, (wHeight / 2.0f) - (float) test.getCenterY());
......@@ -315,6 +323,8 @@ public class GameScreen implements Screen {
batch.setProjectionMatrix(FrozenNumbersGame.viewport.getCamera().combined);
batch.begin();
bg.draw(batch);
bgOverlay.draw(batch);
next.draw(batch);
if (p1.active != null) {
p1.active.draw(batch);
......
......@@ -52,11 +52,11 @@ public class MainMenuScreen implements Screen {
//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() * scaleY);
p1_quest.setCenter(wWidth / 2.0f, wHeight * 0.06f);
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() * scaleY);
p2_quest.setCenter(wWidth / 2.0f, wHeight * (1.0f - 0.06f));
p2_quest.rotate(180);
p1_isready = false;
......
......@@ -3,7 +3,6 @@ package org.milderjoghurt.frozennumbers.screens;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
......@@ -17,7 +16,7 @@ import java.util.Map;
public class TutorialScreen implements Screen {
Game game;
public static Map<String, Screen> m_Screens;
Sprite bg;
Sprite bg, bgOverlay;
Sprite closeBottom, closeTop;
float wWidth, wHeight;
......@@ -34,14 +33,18 @@ public class TutorialScreen implements Screen {
bg.setScale(scaleX, scaleY);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
//generating Close button#
bgOverlay = new Sprite(FrozenNumbersGame.assets.get("sprites/tutorial.png", Texture.class));
bgOverlay.setScale(scaleX, scaleY);
bgOverlay.setCenter(wWidth / 2.0f, wHeight / 2.0f);
//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);
closeBottom.setCenter(wWidth / 2.0f, wHeight * 0.06f);
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.setCenter(wWidth / 2.0f, wHeight * (1.0f - 0.06f));
closeTop.rotate(180);
}
......@@ -70,6 +73,7 @@ public class TutorialScreen implements Screen {
batch.begin();
bg.draw(batch);
bgOverlay.draw(batch);
closeBottom.draw(batch);
closeTop.draw(batch);
......
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