Added graphics for hull, shield and AP display in ship list
This commit is contained in:
parent
8c85102ccc
commit
0ee65ca0cd
Binary file not shown.
BIN
src/assets/images/battle/shiplist-ap-empty.png
Normal file
BIN
src/assets/images/battle/shiplist-ap-empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 617 B |
BIN
src/assets/images/battle/shiplist-ap-full.png
Normal file
BIN
src/assets/images/battle/shiplist-ap-full.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 589 B |
BIN
src/assets/images/battle/shiplist-hull-empty.png
Normal file
BIN
src/assets/images/battle/shiplist-hull-empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 661 B |
BIN
src/assets/images/battle/shiplist-hull-full.png
Normal file
BIN
src/assets/images/battle/shiplist-hull-full.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 711 B |
BIN
src/assets/images/battle/shiplist-shield-empty.png
Normal file
BIN
src/assets/images/battle/shiplist-shield-empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 650 B |
BIN
src/assets/images/battle/shiplist-shield-full.png
Normal file
BIN
src/assets/images/battle/shiplist-shield-full.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 687 B |
|
@ -17,6 +17,12 @@ module SpaceTac.View {
|
|||
this.loadImage("battle/shiplist-playing.png");
|
||||
this.loadImage("battle/shiplist-own.png");
|
||||
this.loadImage("battle/shiplist-enemy.png");
|
||||
this.loadImage("battle/shiplist-ap-empty.png");
|
||||
this.loadImage("battle/shiplist-ap-full.png");
|
||||
this.loadImage("battle/shiplist-hull-empty.png");
|
||||
this.loadImage("battle/shiplist-hull-full.png");
|
||||
this.loadImage("battle/shiplist-shield-empty.png");
|
||||
this.loadImage("battle/shiplist-shield-full.png");
|
||||
this.loadImage("battle/background.jpg");
|
||||
this.loadImage("battle/arena/background.png");
|
||||
this.loadImage("battle/actionbar.png");
|
||||
|
|
|
@ -12,6 +12,9 @@ module SpaceTac.View {
|
|||
// Shield display
|
||||
shield: ValueBar;
|
||||
|
||||
// Action points display
|
||||
ap: ValueBar;
|
||||
|
||||
// Portrait
|
||||
layer_portrait: Phaser.Image;
|
||||
|
||||
|
@ -58,13 +61,23 @@ module SpaceTac.View {
|
|||
this.layer_hover.visible = false;
|
||||
this.addChild(this.layer_hover);
|
||||
|
||||
this.hull = ValueBar.newStandard(list.battleview.game, 85, 28);
|
||||
this.hull.scale.set(0.1, 0.1);
|
||||
this.hull = ValueBar.newStyled(list.battleview.game, "battle-shiplist-hull", 76, 23);
|
||||
this.addChild(this.hull);
|
||||
|
||||
this.shield = ValueBar.newStandard(list.battleview.game, 85, 46);
|
||||
this.shield.scale.set(0.1, 0.1);
|
||||
this.shield = ValueBar.newStyled(list.battleview.game, "battle-shiplist-shield", 76, 35);
|
||||
this.addChild(this.shield);
|
||||
|
||||
this.ap = ValueBar.newStyled(list.battleview.game, "battle-shiplist-ap", 76, 47);
|
||||
this.addChild(this.ap);
|
||||
|
||||
this.updateAttributes();
|
||||
}
|
||||
|
||||
// Update attributes from associated ship
|
||||
updateAttributes() {
|
||||
this.attributeChanged(this.ship.hull);
|
||||
this.attributeChanged(this.ship.shield);
|
||||
this.attributeChanged(this.ship.ap_current);
|
||||
}
|
||||
|
||||
// Called when an attribute for this ship changed through the battle log
|
||||
|
@ -73,6 +86,8 @@ module SpaceTac.View {
|
|||
this.hull.setValue(attribute.current, attribute.maximal);
|
||||
} else if (attribute.code === Game.AttributeCode.Shield) {
|
||||
this.shield.setValue(attribute.current, attribute.maximal);
|
||||
} else if (attribute.code === Game.AttributeCode.AP) {
|
||||
this.ap.setValue(attribute.current, attribute.maximal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,13 @@ module SpaceTac.View {
|
|||
return result;
|
||||
}
|
||||
|
||||
// Create a quick styled bar
|
||||
static newStyled(game: Phaser.Game, base_key: string, x: number, y: number): ValueBar {
|
||||
var result = new ValueBar(game, x, y, base_key + "-empty");
|
||||
result.setBarImage(base_key + "-full");
|
||||
return result;
|
||||
}
|
||||
|
||||
// Build an value bar sprite
|
||||
// background is the key to the image to use as background
|
||||
constructor(game: Phaser.Game, x: number, y: number, background: string,
|
||||
|
|
Loading…
Reference in a new issue