* fix flicker for list labels by not recreating * only show rejoin button when connected * fix initial flicker on text
16 lines
499 B
TypeScript
16 lines
499 B
TypeScript
import * as ex from "excalibur";
|
|
|
|
type ConstructProperties = ex.LabelOptions & ex.ActorArgs;
|
|
|
|
export class Text extends ex.Label {
|
|
constructor(options?: ConstructProperties) {
|
|
super(options);
|
|
// ex.Label sets this.text before this.font in its constructor, so
|
|
// _calculateDimension() runs with the default Font instead of options.font.
|
|
// Re-setting triggers recalculation with the now-correct font.
|
|
|
|
// eslint-disable-next-line no-self-assign
|
|
this.text = this.text;
|
|
}
|
|
}
|