populating grid
This commit is contained in:
@@ -52,13 +52,6 @@ export class CustomWokaPreviewer extends Phaser.GameObjects.Container {
|
||||
[CustomWokaBodyPart.Hat]: this.scene.add.sprite(this.config.bodyPartsOffsetX, 0, "").setVisible(false),
|
||||
};
|
||||
|
||||
// this.updateSprite("accessory1", CustomWokaBodyPart.Accessory);
|
||||
// this.updateSprite("body1", CustomWokaBodyPart.Body);
|
||||
// this.updateSprite("clothes4", CustomWokaBodyPart.Clothes);
|
||||
// this.updateSprite("eyes5", CustomWokaBodyPart.Eyes);
|
||||
// this.updateSprite("hair3", CustomWokaBodyPart.Hair);
|
||||
// this.updateSprite("hat2", CustomWokaBodyPart.Hat);
|
||||
|
||||
this.background = this.scene.add.graphics();
|
||||
this.drawBackground();
|
||||
this.setSize(this.SIZE, this.SIZE);
|
||||
|
||||
@@ -13,6 +13,10 @@ export interface WokaBodyPartSlotConfig {
|
||||
selected?: boolean;
|
||||
}
|
||||
|
||||
export enum WokaBodyPartSlotEvent {
|
||||
Clicked = "WokaBodyPartSlotEvent:Clicked",
|
||||
}
|
||||
|
||||
export class WokaBodyPartSlot extends GridItem {
|
||||
private background: Phaser.GameObjects.Rectangle;
|
||||
private bodyImage: Phaser.GameObjects.Image;
|
||||
@@ -92,8 +96,7 @@ export class WokaBodyPartSlot extends GridItem {
|
||||
super.bindEventHandlers();
|
||||
|
||||
this.on(GridItemEvent.Clicked, () => {
|
||||
this.select(!this.selected);
|
||||
// this.emit(CategoryGridItemEvent.Selected, this.categoryName);
|
||||
this.emit(WokaBodyPartSlotEvent.Clicked, this.selected);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user