1
0
Fork 0

Scale arena to fit screen

Quick graphical fix, will do better later
This commit is contained in:
Michaël Lemaire 2017-01-19 01:27:42 +01:00
parent c2059fd35a
commit d83d7ede9c
3 changed files with 6 additions and 3 deletions

1
TODO
View file

@ -3,6 +3,7 @@
* Re-style cancel button and allow to cancel by clicking the action again
* Add equipment info (or summary) in ship tooltip
* Handle effects overflowing ship tooltip when too numerous
* Proper arena scaling (not graphical, only space coordinates)
* Mobile: think UI layout so that fingers do not block the view (right and left handed)
* Mobile: targetting in two times, using a draggable target indicator
* Add a defeat screen (game over for now)

View file

@ -60,6 +60,8 @@ module SpaceTac.View {
this.range_hint = new RangeHint(this);
this.addChild(this.range_hint);
this.scale.set(1.78, 1.78);
this.init();
}

View file

@ -74,8 +74,8 @@ module SpaceTac.View {
// Find ship sprite to position next to it
var sprite = this.battleview.arena.findShipSprite(ship);
if (sprite) {
var x = sprite.worldPosition.x + sprite.width * 0.5;
var y = sprite.worldPosition.y - sprite.height * 0.5;
var x = sprite.worldPosition.x + sprite.width * sprite.worldScale.x * 0.5;
var y = sprite.worldPosition.y - sprite.height * sprite.worldScale.y * 0.5;
if (y + this.height > this.battleview.getHeight()) {
y = this.battleview.getHeight() - this.height;
}
@ -83,7 +83,7 @@ module SpaceTac.View {
y = 0;
}
if (x + this.width > this.battleview.getWidth()) {
x = sprite.worldPosition.x - sprite.width * 0.5 - this.width;
x = sprite.worldPosition.x - sprite.width * sprite.worldScale.x * 0.5 - this.width;
}
this.position.set(x, y);
} else {