@kitten-science/kitten-scientists
Version:
Add-on for the wonderful incremental browser game: https://kittensgame.com/web/
21 lines • 662 B
JavaScript
import { UiComponent } from "./UiComponent.js";
export class Paragraph extends UiComponent {
/**
* Constructs a paragraph.
*
* @param host - A reference to the host.
* @param text - The text inside the paragraph.
* @param options - Options for the UI element.
*/
constructor(parent, text, options) {
super(parent, { ...options });
this.element = $("<p/>").text(text);
for (const className of options?.classes ?? []) {
this.element.addClass(className);
}
}
toString() {
return `[${Paragraph.name}#${this.componentId}]`;
}
}
//# sourceMappingURL=Paragraph.js.map