1
0
Fork 0

Fixed ship portrait not showing in conversations

This commit is contained in:
Michaël Lemaire 2017-07-31 18:13:55 +02:00
parent 666e3dfc1a
commit dd37f20a43
2 changed files with 13 additions and 2 deletions

View file

@ -247,6 +247,17 @@ module TS.SpaceTac.UI {
this.addInternalChild(image);
}
/**
* Add a static image, from atlases, positioning its center.
*/
addImageA(x: number, y: number, name: string, scale = 1): void {
let info = this.view.getImageInfo(name);
let image = new Phaser.Image(this.container.game, x, y, info.key, info.frame);
image.anchor.set(0.5, 0.5);
image.scale.set(scale);
this.addInternalChild(image);
}
/**
* Add a 2-states toggle button.
*

View file

@ -22,7 +22,7 @@ module TS.SpaceTac.UI {
text_size = 20
text_bold = true
// Portrait or image to display
// Portrait or image to display (from atlases)
image = ""
image_size = 0
image_caption = ""
@ -43,7 +43,7 @@ module TS.SpaceTac.UI {
width -= offset;
let ioffset = style.padding + Math.floor(style.image_size / 2);
this.addImage(ioffset, ioffset, style.image);
this.addImageA(ioffset, ioffset, style.image);
if (style.image_caption) {
let text_size = Math.ceil(style.text_size * 0.6);