Fixed ship portrait not showing in conversations
This commit is contained in:
parent
666e3dfc1a
commit
dd37f20a43
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue