v3.2.4: slight adjustments to new status pane and menu pane UI
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 242 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@@ -368,11 +368,6 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
int uiSize = SPDSettings.interfaceSize();
|
int uiSize = SPDSettings.interfaceSize();
|
||||||
|
|
||||||
menu = new MenuPane();
|
|
||||||
menu.camera = uiCamera;
|
|
||||||
menu.setPos( uiCamera.width-MenuPane.WIDTH-insets.right, largeInsetTop);
|
|
||||||
add(menu);
|
|
||||||
|
|
||||||
//TODO make top bar transparent and add 1px of top status and menu bar to it?
|
//TODO make top bar transparent and add 1px of top status and menu bar to it?
|
||||||
|
|
||||||
//most cutouts supported by the game are small
|
//most cutouts supported by the game are small
|
||||||
@@ -397,14 +392,24 @@ public class GameScene extends PixelScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float screentop = largeInsetTop;
|
||||||
|
if (screentop == 0 && uiSize == 0){
|
||||||
|
screentop--; //on mobile UI, if we render in fullscreen, clip the top 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu = new MenuPane();
|
||||||
|
menu.camera = uiCamera;
|
||||||
|
menu.setPos( uiCamera.width-MenuPane.WIDTH-insets.right, screentop);
|
||||||
|
add(menu);
|
||||||
|
|
||||||
status = new StatusPane( SPDSettings.interfaceSize() > 0 );
|
status = new StatusPane( SPDSettings.interfaceSize() > 0 );
|
||||||
status.camera = uiCamera;
|
status.camera = uiCamera;
|
||||||
StatusPane.cutoutOffset = mediumCutoutOffset;
|
StatusPane.cutoutOffset = mediumCutoutOffset;
|
||||||
status.setRect(insets.left, uiSize > 0 ? uiCamera.height-39-insets.bottom : largeInsetTop, uiCamera.width - insets.left - insets.right, 0 );
|
status.setRect(insets.left, uiSize > 0 ? uiCamera.height-39-insets.bottom : screentop, uiCamera.width - insets.left - insets.right, 0 );
|
||||||
add(status);
|
add(status);
|
||||||
|
|
||||||
if (uiSize < 2 && largeInsetTop != 0) {
|
if (uiSize < 2 && largeInsetTop != 0) {
|
||||||
SkinnedBlock bar = new SkinnedBlock(uiCamera.width, largeInsetTop, TextureCache.createSolid(0xFF1C1E18));
|
SkinnedBlock bar = new SkinnedBlock(uiCamera.width, largeInsetTop, TextureCache.createSolid(0x88000000));
|
||||||
bar.camera = uiCamera;
|
bar.camera = uiCamera;
|
||||||
add(bar);
|
add(bar);
|
||||||
|
|
||||||
@@ -415,7 +420,7 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
boss = new BossHealthBar();
|
boss = new BossHealthBar();
|
||||||
boss.camera = uiCamera;
|
boss.camera = uiCamera;
|
||||||
boss.setPos( insets.left + 6 + (uiCamera.width - insets.left - insets.right - boss.width())/2, largeInsetTop + 21 + mediumCutoutOffset);
|
boss.setPos( (uiCamera.width - boss.width())/2, screentop + 26);
|
||||||
add(boss);
|
add(boss);
|
||||||
|
|
||||||
resume = new ResumeIndicator();
|
resume = new ResumeIndicator();
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ public class MenuPane extends Component {
|
|||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
super.createChildren();
|
super.createChildren();
|
||||||
|
|
||||||
bg = new Image(Assets.Interfaces.MENU, 1, 0, 31, 20);
|
bg = new Image(Assets.Interfaces.MENU, 1, 0, 31, 21);
|
||||||
add(bg);
|
add(bg);
|
||||||
|
|
||||||
versionOverflowBG = new NinePatch(bg.texture, 1, 23, 6, 7, 3, 0, 2, 0);
|
versionOverflowBG = new NinePatch(bg.texture, 1, 22, 6, 8, 3, 0, 2, 0);
|
||||||
add(versionOverflowBG);
|
add(versionOverflowBG);
|
||||||
|
|
||||||
version = new BitmapText( "v" + Game.version , PixelScene.pixelFont);
|
version = new BitmapText( "v" + Game.version , PixelScene.pixelFont);
|
||||||
@@ -168,14 +168,14 @@ public class MenuPane extends Component {
|
|||||||
float overFlow = version.width()-(bg.width()-4-rightMargin);
|
float overFlow = version.width()-(bg.width()-4-rightMargin);
|
||||||
if (overFlow >= 1){
|
if (overFlow >= 1){
|
||||||
version.x = x + 2 - overFlow;
|
version.x = x + 2 - overFlow;
|
||||||
versionOverflowBG.size(overFlow+3, 7);
|
versionOverflowBG.size(overFlow+3, 8);
|
||||||
versionOverflowBG.x = version.x-3;
|
versionOverflowBG.x = version.x-3;
|
||||||
versionOverflowBG.y = y;
|
versionOverflowBG.y = y;
|
||||||
} else {
|
} else {
|
||||||
version.x = x + 3;
|
version.x = x + 3;
|
||||||
versionOverflowBG.visible = false;
|
versionOverflowBG.visible = false;
|
||||||
}
|
}
|
||||||
version.y = y + 2 - (version.baseLine()*version.scale.y)/2f;
|
version.y = y + 3 - (version.baseLine()*version.scale.y)/2f;
|
||||||
version.y -= .001f;
|
version.y -= .001f;
|
||||||
PixelScene.align(version);
|
PixelScene.align(version);
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ public class MenuPane extends Component {
|
|||||||
btnJournal.setPos( btnMenu.left() - btnJournal.width() + 2, y );
|
btnJournal.setPos( btnMenu.left() - btnJournal.width() + 2, y );
|
||||||
|
|
||||||
depthIcon.x = btnJournal.left() - 7 + (7 - depthIcon.width())/2f - 0.1f;
|
depthIcon.x = btnJournal.left() - 7 + (7 - depthIcon.width())/2f - 0.1f;
|
||||||
depthIcon.y = y+7;
|
depthIcon.y = y+8;
|
||||||
PixelScene.align(depthIcon);
|
PixelScene.align(depthIcon);
|
||||||
|
|
||||||
depthText.scale.set(PixelScene.align(0.67f));
|
depthText.scale.set(PixelScene.align(0.67f));
|
||||||
@@ -239,7 +239,7 @@ public class MenuPane extends Component {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
width = bg.width + 4;
|
width = bg.width + 4;
|
||||||
height = bg.height + 9;
|
height = bg.height + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -267,7 +267,7 @@ public class MenuPane extends Component {
|
|||||||
super.layout();
|
super.layout();
|
||||||
|
|
||||||
bg.x = x + 2;
|
bg.x = x + 2;
|
||||||
bg.y = y + 7;
|
bg.y = y + 8;
|
||||||
|
|
||||||
journalIcon.x = bg.x + (bg.width() - journalIcon.width())/2f;
|
journalIcon.x = bg.x + (bg.width() - journalIcon.width())/2f;
|
||||||
journalIcon.y = bg.y + (bg.height() - journalIcon.height())/2f;
|
journalIcon.y = bg.y + (bg.height() - journalIcon.height())/2f;
|
||||||
@@ -372,7 +372,7 @@ public class MenuPane extends Component {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
width = image.width + 4;
|
width = image.width + 4;
|
||||||
height = image.height + 9;
|
height = image.height + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -388,7 +388,7 @@ public class MenuPane extends Component {
|
|||||||
super.layout();
|
super.layout();
|
||||||
|
|
||||||
image.x = x + 2;
|
image.x = x + 2;
|
||||||
image.y = y + 7;
|
image.y = y + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class StatusPane extends Component {
|
|||||||
|
|
||||||
if (large) bg = new NinePatch( asset, 0, 64, 41, 39, 33, 0, 4, 0 );
|
if (large) bg = new NinePatch( asset, 0, 64, 41, 39, 33, 0, 4, 0 );
|
||||||
//right part is transparent now so Ninepatching doesn't actually do anything
|
//right part is transparent now so Ninepatching doesn't actually do anything
|
||||||
else bg = new NinePatch( asset, 0, 0, 128, 35, 85, 0, 45, 0 );
|
else bg = new NinePatch( asset, 0, 0, 128, 38, 85, 0, 45, 0 );
|
||||||
add( bg );
|
add( bg );
|
||||||
|
|
||||||
heroInfo = new Button(){
|
heroInfo = new Button(){
|
||||||
@@ -121,16 +121,16 @@ public class StatusPane extends Component {
|
|||||||
add( compass );
|
add( compass );
|
||||||
|
|
||||||
if (large) rawShielding = new Image(asset, 0, 112, 128, 9);
|
if (large) rawShielding = new Image(asset, 0, 112, 128, 9);
|
||||||
else rawShielding = new Image(asset, 0, 40, 50, 4);
|
else rawShielding = new Image(asset, 0, 44, 50, 4);
|
||||||
rawShielding.alpha(0.5f);
|
rawShielding.alpha(0.5f);
|
||||||
add(rawShielding);
|
add(rawShielding);
|
||||||
|
|
||||||
if (large) shieldedHP = new Image(asset, 0, 112, 128, 9);
|
if (large) shieldedHP = new Image(asset, 0, 112, 128, 9);
|
||||||
else shieldedHP = new Image(asset, 0, 40, 50, 4);
|
else shieldedHP = new Image(asset, 0, 44, 50, 4);
|
||||||
add(shieldedHP);
|
add(shieldedHP);
|
||||||
|
|
||||||
if (large) hp = new Image(asset, 0, 103, 128, 9);
|
if (large) hp = new Image(asset, 0, 103, 128, 9);
|
||||||
else hp = new Image(asset, 0, 36, 50, 4);
|
else hp = new Image(asset, 0, 40, 50, 4);
|
||||||
add( hp );
|
add( hp );
|
||||||
|
|
||||||
hpText = new BitmapText(PixelScene.pixelFont);
|
hpText = new BitmapText(PixelScene.pixelFont);
|
||||||
@@ -147,7 +147,7 @@ public class StatusPane extends Component {
|
|||||||
add(heroInfoOnBar);
|
add(heroInfoOnBar);
|
||||||
|
|
||||||
if (large) exp = new Image(asset, 0, 121, 128, 7);
|
if (large) exp = new Image(asset, 0, 121, 128, 7);
|
||||||
else exp = new Image(asset, 0, 44, 17, 4);
|
else exp = new Image(asset, 0, 48, 17, 4);
|
||||||
add( exp );
|
add( exp );
|
||||||
|
|
||||||
expText = new BitmapText(PixelScene.pixelFont);
|
expText = new BitmapText(PixelScene.pixelFont);
|
||||||
@@ -173,7 +173,7 @@ public class StatusPane extends Component {
|
|||||||
@Override
|
@Override
|
||||||
protected void layout() {
|
protected void layout() {
|
||||||
|
|
||||||
height = large ? 39 : 35;
|
height = large ? 39 : 38;
|
||||||
|
|
||||||
bg.x = x;
|
bg.x = x;
|
||||||
bg.y = y;
|
bg.y = y;
|
||||||
@@ -181,10 +181,10 @@ public class StatusPane extends Component {
|
|||||||
else bg.size( width, bg.height );
|
else bg.size( width, bg.height );
|
||||||
|
|
||||||
avatar.x = bg.x - avatar.width / 2f + 15;
|
avatar.x = bg.x - avatar.width / 2f + 15;
|
||||||
avatar.y = bg.y - avatar.height / 2f + (large ? 15 : 14);
|
avatar.y = bg.y - avatar.height / 2f + 16;
|
||||||
PixelScene.align(avatar);
|
PixelScene.align(avatar);
|
||||||
|
|
||||||
heroInfo.setRect( x, y, 30, large ? 40 : 35 );
|
heroInfo.setRect( x, y, 30, large ? 40 : 36 );
|
||||||
|
|
||||||
compass.x = avatar.x + avatar.width / 2f - compass.origin.x;
|
compass.x = avatar.x + avatar.width / 2f - compass.origin.x;
|
||||||
compass.y = avatar.y + avatar.height / 2f - compass.origin.y;
|
compass.y = avatar.y + avatar.height / 2f - compass.origin.y;
|
||||||
@@ -213,10 +213,10 @@ public class StatusPane extends Component {
|
|||||||
busy.y = y + bg.height - 9;
|
busy.y = y + bg.height - 9;
|
||||||
} else {
|
} else {
|
||||||
exp.x = x+2;
|
exp.x = x+2;
|
||||||
exp.y = y+29;
|
exp.y = y+30;
|
||||||
|
|
||||||
hp.x = shieldedHP.x = rawShielding.x = x + 30;
|
hp.x = shieldedHP.x = rawShielding.x = x + 30;
|
||||||
hp.y = shieldedHP.y = rawShielding.y = y + 1;
|
hp.y = shieldedHP.y = rawShielding.y = y + 2;
|
||||||
|
|
||||||
hpText.scale.set(PixelScene.align(0.5f));
|
hpText.scale.set(PixelScene.align(0.5f));
|
||||||
hpText.x = hp.x + 1;
|
hpText.x = hp.x + 1;
|
||||||
@@ -232,7 +232,7 @@ public class StatusPane extends Component {
|
|||||||
|
|
||||||
heroInfoOnBar.setRect(heroInfo.right(), y, 50, 9);
|
heroInfoOnBar.setRect(heroInfo.right(), y, 50, 9);
|
||||||
|
|
||||||
buffs.setRect( x + 31, y + 7 + cutoutOffset, 50, 8 );
|
buffs.setRect( x + 31, y + 8 + cutoutOffset, 50, 8 );
|
||||||
|
|
||||||
busy.x = x + 1;
|
busy.x = x + 1;
|
||||||
busy.y = y + 37;
|
busy.y = y + 37;
|
||||||
@@ -320,7 +320,7 @@ public class StatusPane extends Component {
|
|||||||
level.text( Integer.toString( lastLvl ) );
|
level.text( Integer.toString( lastLvl ) );
|
||||||
level.measure();
|
level.measure();
|
||||||
level.x = x + 25.5f - level.width() / 2f;
|
level.x = x + 25.5f - level.width() / 2f;
|
||||||
level.y = y + 28.0f - level.baseLine() / 2f;
|
level.y = y + 31.0f - level.baseLine() / 2f;
|
||||||
}
|
}
|
||||||
PixelScene.align(level);
|
PixelScene.align(level);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user