Implement nineslice for some UI windows
This commit is contained in:
1 parent
cb2c77542d
commit
23de25d585
13 files changed
+18
-20
No files matched your search
@@ -8,7 +8,7 @@ import UiHandler from "./uiHandler";
|
||||
|
||||
export default class BallUiHandler extends UiHandler {
|
||||
private pokeballSelectContainer: Phaser.GameObjects.Container;
|
||||
private pokeballSelectBg: Phaser.GameObjects.Image;
|
||||
private pokeballSelectBg: Phaser.GameObjects.NineSlice;
|
||||
private countsText: Phaser.GameObjects.Text;
|
||||
|
||||
private cursorObj: Phaser.GameObjects.Image;
|
||||
@@ -24,7 +24,7 @@ export default class BallUiHandler extends UiHandler {
|
||||
this.pokeballSelectContainer.setVisible(false);
|
||||
ui.add(this.pokeballSelectContainer);
|
||||
|
||||
this.pokeballSelectBg = this.scene.add.image(0, 0, 'ball_window');
|
||||
this.pokeballSelectBg = this.scene.add.nineslice(0, 0, 'window', null, 114, 96, 6, 6, 6, 6);
|
||||
this.pokeballSelectBg.setOrigin(0, 1);
|
||||
this.pokeballSelectContainer.add(this.pokeballSelectBg);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ export default class BattleMessageUiHandler extends MessageUiHandler {
|
||||
|
||||
this.levelUpStatsContainer = levelUpStatsContainer;
|
||||
|
||||
const levelUpStatsBg = this.scene.add.image((this.scene.game.canvas.width / 6), -100, 'level_up_stats');
|
||||
const levelUpStatsBg = this.scene.add.nineslice((this.scene.game.canvas.width / 6), -100, 'window', null, 118, 100, 6, 6, 6, 6);
|
||||
levelUpStatsBg.setOrigin(1, 0);
|
||||
levelUpStatsContainer.add(levelUpStatsBg);
|
||||
|
||||
@@ -75,6 +75,7 @@ export default class BattleMessageUiHandler extends MessageUiHandler {
|
||||
|
||||
const levelUpStatsValuesContent = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 7, -94, '', TextStyle.WINDOW, { maxLines: 6 });
|
||||
levelUpStatsValuesContent.setOrigin(1, 0);
|
||||
levelUpStatsValuesContent.setAlign('right');
|
||||
levelUpStatsContainer.add(levelUpStatsValuesContent);
|
||||
|
||||
this.levelUpStatsValuesContent = levelUpStatsValuesContent;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import BattleScene, { Button } from "../battle-scene";
|
||||
import BattleScene from "../battle-scene";
|
||||
import OptionSelectUiHandler from "./option-select-ui-handler";
|
||||
import { addTextObject, TextStyle } from "./text";
|
||||
import { Mode } from "./ui";
|
||||
|
||||
export default class ConfirmUiHandler extends OptionSelectUiHandler {
|
||||
@@ -11,11 +10,11 @@ export default class ConfirmUiHandler extends OptionSelectUiHandler {
|
||||
super(scene, Mode.CONFIRM);
|
||||
}
|
||||
|
||||
getWindowName(): string {
|
||||
return 'boolean_window';
|
||||
getWindowWidth(): integer {
|
||||
return 48;
|
||||
}
|
||||
|
||||
getWindowWidth(): integer {
|
||||
getWindowHeight(): integer {
|
||||
return 48;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ export default class GameModeSelectUiHandler extends OptionSelectUiHandler {
|
||||
super(scene, Mode.GAME_MODE_SELECT);
|
||||
}
|
||||
|
||||
getWindowName(): string {
|
||||
return 'game_mode_select_window';
|
||||
getWindowWidth(): integer {
|
||||
return 64;
|
||||
}
|
||||
|
||||
getWindowWidth(): integer {
|
||||
getWindowHeight(): number {
|
||||
return 64;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export default abstract class OptionSelectUiHandler extends UiHandler {
|
||||
protected handlers: Function[];
|
||||
|
||||
protected optionSelectContainer: Phaser.GameObjects.Container;
|
||||
protected optionSelectBg: Phaser.GameObjects.Image;
|
||||
protected optionSelectBg: Phaser.GameObjects.NineSlice;
|
||||
|
||||
private cursorObj: Phaser.GameObjects.Image;
|
||||
|
||||
@@ -15,10 +15,10 @@ export default abstract class OptionSelectUiHandler extends UiHandler {
|
||||
super(scene, mode);
|
||||
}
|
||||
|
||||
abstract getWindowName(): string;
|
||||
|
||||
abstract getWindowWidth(): integer;
|
||||
|
||||
abstract getWindowHeight(): integer;
|
||||
|
||||
abstract getOptions(): string[];
|
||||
|
||||
setup() {
|
||||
@@ -28,7 +28,7 @@ export default abstract class OptionSelectUiHandler extends UiHandler {
|
||||
this.optionSelectContainer.setVisible(false);
|
||||
ui.add(this.optionSelectContainer);
|
||||
|
||||
this.optionSelectBg = this.scene.add.image(0, 0, this.getWindowName());
|
||||
this.optionSelectBg = this.scene.add.nineslice(0, 0, 'window', null, this.getWindowWidth(), this.getWindowHeight(), 6, 6, 6, 6);
|
||||
this.optionSelectBg.setOrigin(0, 1);
|
||||
this.optionSelectContainer.add(this.optionSelectBg);
|
||||
|
||||
|
||||
Reference in new issue
Block a user