v0.7.4: adjusted elements at scene corners to accommodate curved displays

This commit is contained in:
Evan Debenham 2019-07-08 02:35:48 -04:00
parent 3841f593f8
commit 1c4603d6e4
8 changed files with 30 additions and 27 deletions

View File

@ -117,7 +117,7 @@ public class AlchemyScene extends PixelScene {
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);
title.x = (Camera.main.width - title.width()) / 2f;
title.y = (16 - title.baseLine()) / 2f;
title.y = (20 - title.baseLine()) / 2f;
align(title);
add(title);
@ -270,7 +270,7 @@ public class AlchemyScene extends PixelScene {
});
}
};
btnGuide.setRect(0, 0, 16, 16);
btnGuide.setRect(0, 0, 20, 20);
add(btnGuide);
energyLeft = PixelScene.renderText(Messages.get(AlchemyScene.class, "energy", availableEnergy()), 9);

View File

@ -62,7 +62,7 @@ public class BadgesScene extends PixelScene {
add( archs );
float left = 5;
float top = 16;
float top = 20;
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);

View File

@ -58,7 +58,7 @@ public class ChangesScene extends PixelScene {
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2f;
title.y = (16 - title.baseLine()) / 2f;
title.y = (20 - title.baseLine()) / 2f;
align(title);
add(title);
@ -69,7 +69,7 @@ public class ChangesScene extends PixelScene {
NinePatch panel = Chrome.get(Chrome.Type.TOAST);
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
int ph = h - 32;
int ph = h - 35;
panel.size( pw, ph );
panel.x = (w - pw) / 2f;

View File

@ -75,7 +75,7 @@ public class RankingsScene extends PixelScene {
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9);
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2f;
title.y = (16 - title.baseLine()) / 2f;
title.y = (20 - title.baseLine()) / 2f;
align(title);
add(title);

View File

@ -72,7 +72,7 @@ public class StartScene extends PixelScene {
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9);
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2f;
title.y = (16 - title.baseLine()) / 2f;
title.y = (20 - title.baseLine()) / 2f;
align(title);
add(title);

View File

@ -66,13 +66,14 @@ public class TitleScene extends PixelScene {
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
add( title );
float topRegion = Math.max(95f, h*0.45f);
float topRegion = Math.max(title.height, h*0.45f);
title.x = (w - title.width()) / 2f;
if (SPDSettings.landscape())
if (SPDSettings.landscape()) {
title.y = (topRegion - title.height()) / 2f;
else
title.y = 16 + (topRegion - title.height() - 16) / 2f;
} else {
title.y = 20 + (topRegion - title.height() - 20) / 2f;
}
align(title);
@ -159,24 +160,25 @@ public class TitleScene extends PixelScene {
BitmapText version = new BitmapText( "v " + Game.version + "", pixelFont);
version.measure();
version.hardlight( 0x888888 );
version.x = w - version.width();
version.y = h - version.height();
version.x = w - version.width() - 4;
version.y = h - version.height() - 2;
add( version );
Button changes = new ChangesButton();
changes.setPos( w-changes.width(), h - version.height() - changes.height());
changes.setPos( version.x + version.width() - changes.width(),
version.y - changes.height());
add( changes );
int pos = 0;
int pos = 2;
PrefsButton btnPrefs = new PrefsButton();
btnPrefs.setRect( pos, 0, 16, 16 );
btnPrefs.setRect( pos, 0, 16, 20 );
add( btnPrefs );
pos += btnPrefs.width();
LanguageButton btnLang = new LanguageButton();
btnLang.setRect(pos, 0, 14, 16);
btnLang.setRect(pos, 0, 16, 20);
add( btnLang );
ExitButton btnExit = new ExitButton();

View File

@ -66,14 +66,15 @@ public class WelcomeScene extends PixelScene {
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
title.brightness(0.6f);
add( title );
float topRegion = Math.max(95f, h*0.45f);
float topRegion = Math.max(title.height, h*0.45f);
title.x = (w - title.width()) / 2f;
if (SPDSettings.landscape())
if (SPDSettings.landscape()) {
title.y = (topRegion - title.height()) / 2f;
else
title.y = 16 + (topRegion - title.height() - 16) / 2f;
} else {
title.y = 20 + (topRegion - title.height() - 20) / 2f;
}
align(title);

View File

@ -36,8 +36,8 @@ public class ExitButton extends Button {
public ExitButton() {
super();
width = image.width;
height = image.height;
width = image.width+4;
height = image.height+4;
}
@Override
@ -52,8 +52,8 @@ public class ExitButton extends Button {
protected void layout() {
super.layout();
image.x = x;
image.y = y;
image.x = x+2;
image.y = y+2;
}
@Override