character sheet: Limit width of equipment tooltip
This commit is contained in:
parent
58b3cdf5b2
commit
d1fa45bf7a
|
@ -158,7 +158,7 @@ module TS.SpaceTac.UI {
|
|||
*/
|
||||
fillTooltip(filler: TooltipFiller): boolean {
|
||||
filler.addText(0, 0, this.item.getFullName(), "#cccccc", 20, false, true);
|
||||
filler.addText(0, 40, this.item.getFullDescription(), "#cccccc", 18);
|
||||
filler.addText(0, 40, this.item.getFullDescription(), "#cccccc", 18, false, false, 700);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,9 +115,13 @@ module TS.SpaceTac.UI {
|
|||
/**
|
||||
* Add a text to the content
|
||||
*/
|
||||
addText(x: number, y: number, content: string, color = "#ffffff", size = 16, center = false, bold = false): void {
|
||||
addText(x: number, y: number, content: string, color = "#ffffff", size = 16, center = false, bold = false, width = 0): void {
|
||||
let style = { font: `${bold ? "bold " : ""}${size}pt Arial`, fill: color, align: center ? "center" : "left" };
|
||||
let text = new Phaser.Text(this.container.game, x, y, content, style);
|
||||
if (width) {
|
||||
text.wordWrap = true;
|
||||
text.wordWrapWidth = width;
|
||||
}
|
||||
this.container.content.add(text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue