1
0
Fork 0

Added action points progress bar graphics

This commit is contained in:
Michaël Lemaire 2015-01-18 01:00:00 +01:00
parent be72bfd4d1
commit 62e2e3239d
6 changed files with 13 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -14,6 +14,8 @@ module SpaceTac.View {
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-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("arena-ship", "assets/images/battle/ship01.png");
this.load.image("ui-bar-standard-background", "assets/images/ui/bars/standard-background.png");

View file

@ -9,6 +9,9 @@ module SpaceTac.View {
// List of action icons
actions: ActionIcon[];
// Progress bar displaying action points
actionpoints: ValueBar;
// Create an empty action bar
constructor(battleview: BattleView) {
this.battleview = battleview;
@ -17,7 +20,11 @@ module SpaceTac.View {
super(battleview.game, 170, 0, "ui-battle-actionbar");
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

View file

@ -64,13 +64,8 @@ module SpaceTac.View {
// Add UI elements
this.action_bar = new ActionBar(this);
this.ship_list = new ShipList(this);
this.card_playing = new ShipCard(this, 500, 0);
this.card_hovered = new ShipCard(this, 500, 300);
// Add a test progress bar
var bar = ValueBar.newStandard(game, 300, 300);
bar.setValue(50, 100);
this.ui.add(bar);
this.card_playing = new ShipCard(this, 1060, 130);
this.card_hovered = new ShipCard(this, 1060, 430);
// Start processing the battle log
this.log_processor = new LogProcessor(this);

View file

@ -31,7 +31,7 @@ module SpaceTac.View {
}
// 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.addChild(this.bar_sprite);
}