Scale arena to fit screen
Quick graphical fix, will do better later
This commit is contained in:
parent
c2059fd35a
commit
d83d7ede9c
1
TODO
1
TODO
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue