Files
autobeerpong/src/frontend/src/ScreenElements/Text.ts
T
lucas 14516a878f Frontend - fix flickers (#44)
* fix flicker for list labels by not recreating
* only show rejoin button when connected
* fix initial flicker on text
2026-05-04 21:07:48 +02:00

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;
}
}