added bound

This commit is contained in:
Mashy 2019-02-17 12:02:32 +10:00
parent 2c2e1dddbe
commit 99cc144361

View File

@ -13,9 +13,10 @@ class Vbox extends Phaser.Scene {
create(vbox) { create(vbox) {
this.cameras.main.setViewport(X, Y, WIDTH, HEIGHT); this.cameras.main.setViewport(X, Y, WIDTH, HEIGHT);
this.add.text(WIDTH / 10, 0, 'VariBox', TEXT.HEADER) this.add.text(WIDTH / 10, 0, 'free', TEXT.HEADER);
this.add.text(WIDTH / 5, 0, 'bound', TEXT.HEADER);
const drawItem = (item, i) => { const drawFree = (item, i) => {
this.add this.add
.text(WIDTH / 10, 25 * (i + 2), item, TEXT.NORMAL) .text(WIDTH / 10, 25 * (i + 2), item, TEXT.NORMAL)
.setInteractive() .setInteractive()
@ -23,9 +24,19 @@ class Vbox extends Phaser.Scene {
this.registry.get('ws').sendVboxAccept(vbox.game, i); this.registry.get('ws').sendVboxAccept(vbox.game, i);
console.log(item); console.log(item);
}); });
;
}; };
vbox.free.forEach(drawItem);
const drawBound = (item, i) => {
this.add
.text(WIDTH / 5, 25 * (i + 2), item, TEXT.NORMAL)
.setInteractive()
.on('pointerdown', () => {
// this.registry.get('ws').sendVboxAccept(vbox.game, i);
console.log(item);
});
};
vbox.free.forEach(drawFree);
vbox.bound.forEach(drawBound);
} }
cleanUp() { cleanUp() {