1
0
Fork 0

Added action bar background

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

1
.gitignore vendored
View File

@ -10,4 +10,5 @@
/core
/node_modules
/src/vendor
/graphics/**/*.blend?*

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
graphics/ui/ui.blend Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -9,7 +9,7 @@ html, body {
}
.game {
width: 800px;
height: 600px;
width: 1280px;
height: 720px;
margin: 20px auto;
}

View File

@ -6,7 +6,7 @@ module SpaceTac {
// Router between game views
export class GameRouter extends Phaser.Game {
constructor() {
super(800, 600, Phaser.AUTO, '-space-tac');
super(1280, 720, Phaser.AUTO, '-space-tac');
this.state.add('boot', View.Boot);
this.state.add('preload', View.Preload);

View File

@ -13,6 +13,7 @@ module SpaceTac.View {
this.load.image("ui-shiplist-own", "assets/images/battle/shiplist-own.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-battle-actionbar", "assets/images/ui/battle/actionbar.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

@ -2,7 +2,7 @@ module SpaceTac.View {
"use strict";
// Bar with all available action icons displayed
export class ActionBar extends Phaser.Group {
export class ActionBar extends Phaser.Sprite {
// Link to the parent battleview
battleview: BattleView;
@ -14,19 +14,12 @@ module SpaceTac.View {
this.battleview = battleview;
this.actions = [];
super(battleview.game, battleview.ui);
super(battleview.game, 170, 0, "ui-battle-actionbar");
battleview.ui.add(this);
this.update();
}
// Update the bar status (and position)
update() {
super.update();
this.x = 100;
}
// Clear the action icons
clearAll(): void {
this.actions.forEach((action: ActionIcon) => {
@ -37,7 +30,7 @@ module SpaceTac.View {
// Add an action icon
addAction(ship: Game.Ship, action: Game.BaseAction): ActionIcon {
var icon = new ActionIcon(this, this.actions.length * 50, 0, ship, action);
var icon = new ActionIcon(this, 110 + this.actions.length * 50, 25, ship, action);
this.actions.push(icon);
return icon;
}

View File

@ -23,7 +23,7 @@ module SpaceTac.View {
this.action = action;
super(bar.game, x, y, "action-" + action.code);
bar.add(this);
bar.addChild(this);
// TODO Handle action.canBeUsed() result to enable/disable the button