Added action points progress bar graphics
This commit is contained in:
parent
be72bfd4d1
commit
62e2e3239d
BIN
src/assets/images/ui/battle/actionpointsempty.png
Normal file
BIN
src/assets/images/ui/battle/actionpointsempty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
src/assets/images/ui/battle/actionpointsfull.png
Normal file
BIN
src/assets/images/ui/battle/actionpointsfull.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -14,6 +14,8 @@ module SpaceTac.View {
|
||||||
this.load.image("ui-shiplist-enemy", "assets/images/battle/shiplist-enemy.png");
|
this.load.image("ui-shiplist-enemy", "assets/images/battle/shiplist-enemy.png");
|
||||||
this.load.image("ui-arena-background", "assets/images/battle/arena-background.png");
|
this.load.image("ui-arena-background", "assets/images/battle/arena-background.png");
|
||||||
this.load.image("ui-battle-actionbar", "assets/images/ui/battle/actionbar.png");
|
this.load.image("ui-battle-actionbar", "assets/images/ui/battle/actionbar.png");
|
||||||
|
this.load.image("ui-battle-actionpointsempty", "assets/images/ui/battle/actionpointsempty.png");
|
||||||
|
this.load.image("ui-battle-actionpointsfull", "assets/images/ui/battle/actionpointsfull.png");
|
||||||
this.load.image("ui-ship-card", "assets/images/battle/ship-card.png");
|
this.load.image("ui-ship-card", "assets/images/battle/ship-card.png");
|
||||||
this.load.image("arena-ship", "assets/images/battle/ship01.png");
|
this.load.image("arena-ship", "assets/images/battle/ship01.png");
|
||||||
this.load.image("ui-bar-standard-background", "assets/images/ui/bars/standard-background.png");
|
this.load.image("ui-bar-standard-background", "assets/images/ui/bars/standard-background.png");
|
||||||
|
|
|
@ -9,6 +9,9 @@ module SpaceTac.View {
|
||||||
// List of action icons
|
// List of action icons
|
||||||
actions: ActionIcon[];
|
actions: ActionIcon[];
|
||||||
|
|
||||||
|
// Progress bar displaying action points
|
||||||
|
actionpoints: ValueBar;
|
||||||
|
|
||||||
// Create an empty action bar
|
// Create an empty action bar
|
||||||
constructor(battleview: BattleView) {
|
constructor(battleview: BattleView) {
|
||||||
this.battleview = battleview;
|
this.battleview = battleview;
|
||||||
|
@ -17,7 +20,11 @@ module SpaceTac.View {
|
||||||
super(battleview.game, 170, 0, "ui-battle-actionbar");
|
super(battleview.game, 170, 0, "ui-battle-actionbar");
|
||||||
battleview.ui.add(this);
|
battleview.ui.add(this);
|
||||||
|
|
||||||
this.update();
|
// Action points progress bar
|
||||||
|
this.actionpoints = new ValueBar(battleview.game, 119, 76, "ui-battle-actionpointsempty");
|
||||||
|
this.actionpoints.setBarImage("ui-battle-actionpointsfull");
|
||||||
|
this.actionpoints.setValue(50, 100);
|
||||||
|
this.addChild(this.actionpoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the action icons
|
// Clear the action icons
|
||||||
|
|
|
@ -64,13 +64,8 @@ module SpaceTac.View {
|
||||||
// Add UI elements
|
// Add UI elements
|
||||||
this.action_bar = new ActionBar(this);
|
this.action_bar = new ActionBar(this);
|
||||||
this.ship_list = new ShipList(this);
|
this.ship_list = new ShipList(this);
|
||||||
this.card_playing = new ShipCard(this, 500, 0);
|
this.card_playing = new ShipCard(this, 1060, 130);
|
||||||
this.card_hovered = new ShipCard(this, 500, 300);
|
this.card_hovered = new ShipCard(this, 1060, 430);
|
||||||
|
|
||||||
// Add a test progress bar
|
|
||||||
var bar = ValueBar.newStandard(game, 300, 300);
|
|
||||||
bar.setValue(50, 100);
|
|
||||||
this.ui.add(bar);
|
|
||||||
|
|
||||||
// Start processing the battle log
|
// Start processing the battle log
|
||||||
this.log_processor = new LogProcessor(this);
|
this.log_processor = new LogProcessor(this);
|
||||||
|
|
|
@ -31,7 +31,7 @@ module SpaceTac.View {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set an image to use for the bar
|
// Set an image to use for the bar
|
||||||
setBarImage(key: string, offset_x: number, offset_y: number): void {
|
setBarImage(key: string, offset_x: number = 0, offset_y: number = 0): void {
|
||||||
this.bar_sprite = new Phaser.Sprite(this.game, offset_x, offset_y, key);
|
this.bar_sprite = new Phaser.Sprite(this.game, offset_x, offset_y, key);
|
||||||
this.addChild(this.bar_sprite);
|
this.addChild(this.bar_sprite);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue