mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 12:28:03 +08:00
Fixing game crashes on web
This commit is contained in:
@ -15,7 +15,7 @@ class TextBoxConfig {
|
||||
final double timePerChar;
|
||||
final double dismissDelay;
|
||||
|
||||
const TextBoxConfig({
|
||||
TextBoxConfig({
|
||||
this.maxWidth = 200.0,
|
||||
this.margin = 8.0,
|
||||
this.timePerChar = 0.0,
|
||||
@ -46,11 +46,12 @@ class TextBoxComponent extends PositionComponent with Resizable {
|
||||
|
||||
TextBoxConfig get boxConfig => _boxConfig;
|
||||
|
||||
TextBoxComponent(String text,
|
||||
{TextConfig config = const TextConfig(),
|
||||
TextBoxConfig boxConfig = const TextBoxConfig()}) {
|
||||
_boxConfig = boxConfig;
|
||||
_config = config;
|
||||
TextBoxComponent(String text, {
|
||||
TextConfig config,
|
||||
TextBoxConfig boxConfig,
|
||||
}) {
|
||||
_boxConfig = boxConfig ?? TextBoxConfig();
|
||||
_config = config ?? TextConfig();
|
||||
_text = text;
|
||||
_lines = [];
|
||||
text.split(' ').forEach((word) {
|
||||
|
||||
@ -27,8 +27,8 @@ class TextComponent extends PositionComponent {
|
||||
_updateBox();
|
||||
}
|
||||
|
||||
TextComponent(this._text, {TextConfig config = const TextConfig()}) {
|
||||
_config = config;
|
||||
TextComponent(this._text, {TextConfig config }) {
|
||||
_config = config ?? TextConfig();
|
||||
_updateBox();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user