Commit 21e8a637 authored by Matyáš Latner's avatar Matyáš Latner

#34 Translated news paper in Panorama screen, refactored background images -> disabled blending

parent fd97267d
......@@ -11,7 +11,6 @@ import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.loader.application.ApplicationTextManager;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.screen.createuser.FormScreen;
import cz.nic.tablexia.screen.gamemenu.GameMenuScreen;
import cz.nic.tablexia.util.Log;
......
......@@ -27,6 +27,7 @@ import cz.nic.tablexia.loader.application.ApplicationAtlasManager;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.util.ScaleUtil;
import cz.nic.tablexia.util.Utility;
import cz.nic.tablexia.util.ui.TablexiaNoBlendingImage;
import cz.nic.tablexia.util.ui.dialog.TablexiaDialog;
import cz.nic.tablexia.util.ui.dialog.TextDialog;
import cz.nic.tablexia.util.ui.dialog.text.DialogTextContent;
......@@ -40,6 +41,12 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
public static final String SFX_PATH = "sfx/";
public static final String MFX_PATH = "mfx/";
public static final String BALCONY = GFX_PATH + "balcony";
public static final String BALCONY_WINTER = GFX_PATH + "balcony_winter";
public static final String BALCONY_NEWS_TITLE = GFX_PATH + "balcony_news_title";
public static final String BALCONY_BLUR = GFX_PATH + "balcony_blur";
public static final String BALCONY_BLUR_WINTER = GFX_PATH + "balcony_blur_winter";
public static final String SFX_NOVINY_PRILET = SFX_PATH + "noviny_prilet.mp3";
public static final String SFX_NOVINY_ROZBALENI = SFX_PATH + "noviny_rozbaleni.mp3";
......@@ -55,12 +62,6 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
private TextureRegion clickmap;
@Override
protected String prepareScreenTextResourcesAssetName() {
// no text loading
return null;
}
@Override
protected int[][] prepareScreenData(Map<String, String> screenState) {
clickmap = getScreenTextureRegion(GFX_PATH + "newspaper/clickmap");
......@@ -100,11 +101,16 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
ScaleUtil.setFullScreen(group, getStage());
boolean isWinter = true;
Image balcony = new Image(getScreenTextureRegion(GFX_PATH + "balcony" + (isWinter ? "_winter" : "")));
Image balcony = new TablexiaNoBlendingImage(getScreenTextureRegion(isWinter ? BALCONY_WINTER : BALCONY));
ScaleUtil.setFullScreen(balcony, getStage());
group.addActor(balcony);
final Image balconyBlur = new Image(getScreenTextureRegion(GFX_PATH + "balcony_blur" + (isWinter ? "_winter" : "")));
Image balconyNewsTitle = new Image(getScreenTextureRegion(BALCONY_NEWS_TITLE));
ScaleUtil.setFullScreen(balconyNewsTitle, getStage());
balconyNewsTitle.setTouchable(Touchable.disabled);
group.addActor(balconyNewsTitle);
final Image balconyBlur = new TablexiaNoBlendingImage(getScreenTextureRegion(isWinter ? BALCONY_BLUR_WINTER : BALCONY_BLUR));
ScaleUtil.setFullScreen(balconyBlur, getStage());
balconyBlur.setVisible(false);
group.addActor(balconyBlur);
......@@ -411,17 +417,17 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
// TODO hide finger if scrolled over 0.7
//tile0, tile1
group.addActor(ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile0"), getStage().getHeight()));
group.addActor(ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile1"), getStage().getHeight()));
group.addActor(ScaleUtil.createNoBlendingImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile0"), getStage().getHeight()));
group.addActor(ScaleUtil.createNoBlendingImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile1"), getStage().getHeight()));
//tile2
Stack tile2 = new Stack();
tile2.add(ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile2"), getStage().getHeight()));
tile2.add(ScaleUtil.createNoBlendingImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile2"), getStage().getHeight()));
tile2.add(ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile2_title"), getStage().getHeight()));
group.addActor(tile2);
//tile3
final Image tile3Background = ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile3"), getStage().getHeight());
final Image tile3Background = ScaleUtil.createNoBlendingImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile3"), getStage().getHeight());
final Image tile3Title = ScaleUtil.createImageToHeight(getScreenTextureRegion(GFX_PATH + "swipe/tile3_title"), getStage().getHeight());
final Group detectiveDoor = new Group();
tile3Title.addListener(new ClickListener() {
......@@ -478,7 +484,7 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
private void showDialog(final int num) {
String text = getText("createuser_detective_" + num);
final Dialog dialog = new TextDialog(getStage().getWidth() * 0.3f, getStage().getWidth() * 0.26f, getStage().getWidth() * 0.3f, getStage().getWidth() * 0.2f, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON, new DialogTextContent("", text)).show(getStage());
playMusic(MFX_PATH + "detective/" + num);
playMusic(MFX_PATH + "detective/" + num + ".mp3");
dialog.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
......
......@@ -7,6 +7,7 @@ import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.util.ui.TablexiaNoBlendingImage;
/**
* Created by lhoracek on 4/7/15.
......@@ -105,6 +106,12 @@ public class ScaleUtil {
return image;
}
public static TablexiaNoBlendingImage createNoBlendingImageToHeight(TextureRegion textureRegion, float height) {
TablexiaNoBlendingImage image = new TablexiaNoBlendingImage(textureRegion);
image.setSize(getWidth(textureRegion.getRegionWidth(), textureRegion.getRegionHeight(), height), height);
return image;
}
public static float getHeight(float origWidth, float origHeight, float targetWidth) {
return targetWidth / (origWidth / origHeight);
}
......
Markdown is supported
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