Replaced some sneaky instances of scaledCanvas / 2

This commit is contained in:
Wlowscha 2025-07-28 22:51:45 +02:00
parent 2df8a7f255
commit f6e477c2f9
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
5 changed files with 11 additions and 11 deletions

View File

@ -25,7 +25,7 @@ export class EndCardPhase extends Phase {
globalScene.field.add(this.endCard);
this.text = addTextObject(
globalScene.game.canvas.width / 12,
globalScene.scaledCanvas.width / 2,
globalScene.scaledCanvas.height - 16,
i18next.t("battle:congratulations"),
TextStyle.SUMMARY,

View File

@ -49,7 +49,7 @@ export class LoginFormUiHandler extends FormModalUiHandler {
private buildExternalPartyContainer() {
this.externalPartyContainer = globalScene.add.container(0, 0);
this.externalPartyContainer.setInteractive(
new Phaser.Geom.Rectangle(0, 0, globalScene.game.canvas.width / 12, globalScene.game.canvas.height / 12),
new Phaser.Geom.Rectangle(0, 0, globalScene.scaledCanvas.width / 2, globalScene.scaledCanvas.height / 2),
Phaser.Geom.Rectangle.Contains,
);
this.externalPartyTitle = addTextObject(0, 4, "", TextStyle.SETTINGS_LABEL);

View File

@ -126,8 +126,8 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler {
this.lockRarityButtonContainer.add(this.lockRarityButtonText);
this.continueButtonContainer = globalScene.add.container(
globalScene.game.canvas.width / 12,
-(globalScene.game.canvas.height / 12),
globalScene.scaledCanvas.width / 2,
-(globalScene.scaledCanvas.height / 2),
);
this.continueButtonContainer.setVisible(false);
ui.add(this.continueButtonContainer);
@ -217,7 +217,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler {
const sliceWidth = globalScene.scaledCanvas.width / (typeOptions.length + 2);
const option = new ModifierOption(
sliceWidth * (m + 1) + sliceWidth * 0.5,
-globalScene.game.canvas.height / 12 + optionsYOffset,
-globalScene.scaledCanvas.height / 2 + optionsYOffset,
typeOptions[m],
);
option.setScale(0.5);
@ -241,7 +241,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler {
const sliceWidth = globalScene.scaledCanvas.width / (rowOptions.length + 2);
const option = new ModifierOption(
sliceWidth * (col + 1) + sliceWidth * 0.5,
-globalScene.game.canvas.height / 12 - globalScene.game.canvas.height / 32 - (42 - (28 * row - 1)),
-globalScene.scaledCanvas.height / 2 - globalScene.game.canvas.height / 32 - (42 - (28 * row - 1)),
shopTypeOptions[m],
);
option.setScale(0.375);
@ -554,7 +554,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler {
this.cursorObj.setScale(1.25);
this.cursorObj.setPosition(
globalScene.game.canvas.width / 18 + 23,
-globalScene.game.canvas.height / 12 -
-globalScene.scaledCanvas.height / 2 -
(this.shopOptionsRows.length > 1 ? SINGLE_SHOP_ROW_YOFFSET - 2 : DOUBLE_SHOP_ROW_YOFFSET - 2),
);
ui.showText(i18next.t("modifierSelectUiHandler:continueNextWaveDescription"));
@ -566,14 +566,14 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler {
// Cursor on free items
this.cursorObj.setPosition(
sliceWidth * (cursor + 1) + sliceWidth * 0.5 - 20,
-globalScene.game.canvas.height / 12 -
-globalScene.scaledCanvas.height / 2 -
(this.shopOptionsRows.length > 1 ? SINGLE_SHOP_ROW_YOFFSET - 2 : DOUBLE_SHOP_ROW_YOFFSET - 2),
);
} else {
// Cursor on paying items
this.cursorObj.setPosition(
sliceWidth * (cursor + 1) + sliceWidth * 0.5 - 16,
-globalScene.game.canvas.height / 12 -
-globalScene.scaledCanvas.height / 2 -
globalScene.game.canvas.height / 32 -
(-14 + 28 * (this.rowCursor - (this.shopOptionsRows.length - 1))),
);

View File

@ -312,7 +312,7 @@ export class PartyUiHandler extends MessageUiHandler {
top: true,
x: 1,
y: -MoveInfoOverlay.getHeight() - 1,
width: globalScene.game.canvas.width / 12 - 30,
width: globalScene.scaledCanvas.width / 2 - 30,
});
ui.add(this.moveInfoOverlay);

View File

@ -971,7 +971,7 @@ export class RunInfoUiHandler extends UiHandler {
endCard.setOrigin(0);
endCard.setScale(0.5);
const text = addTextObject(
globalScene.game.canvas.width / 12,
globalScene.scaledCanvas.width / 2,
globalScene.scaledCanvas.height - 16,
i18next.t("battle:congratulations"),
TextStyle.SUMMARY,