crispy pixels

This commit is contained in:
Piotr 'pwh' Hanusiak
2022-03-22 09:44:26 +01:00
parent ccf897f320
commit 2cf55cac7e
+6 -6
View File
@@ -126,7 +126,7 @@ export class CustomizeScene extends AbstractCharacterScene {
}, },
spacing: 5, spacing: 5,
debug: { debug: {
showDraggableSpace: true, showDraggableSpace: false,
}, },
}); });
this.bodyPartsDraggableGridForeground = this.add.graphics(); this.bodyPartsDraggableGridForeground = this.add.graphics();
@@ -187,8 +187,8 @@ export class CustomizeScene extends AbstractCharacterScene {
} }
private drawGridBackground(gridPosition: { x: number; y: number }): void { private drawGridBackground(gridPosition: { x: number; y: number }): void {
const gridBackgroundWidth = 500; const gridBackgroundWidth = innerWidth / waScaleManager.getActualZoom();
const gridBackgroundHeight = 170; const gridBackgroundHeight = 130;
this.bodyPartsDraggableGridBackground.clear(); this.bodyPartsDraggableGridBackground.clear();
this.bodyPartsDraggableGridBackground.fillStyle(0xf9f9f9); this.bodyPartsDraggableGridBackground.fillStyle(0xf9f9f9);
this.bodyPartsDraggableGridBackground.fillRect( this.bodyPartsDraggableGridBackground.fillRect(
@@ -200,8 +200,8 @@ export class CustomizeScene extends AbstractCharacterScene {
} }
private drawGridForeground(gridPosition: { x: number; y: number }): void { private drawGridForeground(gridPosition: { x: number; y: number }): void {
const gridBackgroundWidth = 500; const gridBackgroundWidth = innerWidth / waScaleManager.getActualZoom();
const gridBackgroundHeight = 170; const gridBackgroundHeight = 130;
this.bodyPartsDraggableGridForeground.clear(); this.bodyPartsDraggableGridForeground.clear();
this.bodyPartsDraggableGridForeground.lineStyle(2, 0xadafbc); this.bodyPartsDraggableGridForeground.lineStyle(2, 0xadafbc);
this.bodyPartsDraggableGridForeground.strokeRect( this.bodyPartsDraggableGridForeground.strokeRect(
@@ -285,7 +285,7 @@ export class CustomizeScene extends AbstractCharacterScene {
private handleBodyPartsDraggableGridOnResize(): void { private handleBodyPartsDraggableGridOnResize(): void {
const gridHeight = 125; const gridHeight = 125;
const gridWidth = (innerWidth * (this.isVertical ? 1 : 0.8)) / waScaleManager.getActualZoom(); const gridWidth = innerWidth / waScaleManager.getActualZoom();
const gridPos = { const gridPos = {
x: this.cameras.main.worldView.x + this.cameras.main.width / 2, x: this.cameras.main.worldView.x + this.cameras.main.width / 2,
y: this.cameras.main.worldView.y + this.cameras.main.height - gridHeight * 0.5, y: this.cameras.main.worldView.y + this.cameras.main.height - gridHeight * 0.5,