suggestions

pull/355/head
Erick Zanardo 3 years ago
parent 8c4cff701d
commit a2fccc0b3a

@ -75,9 +75,9 @@ class ErrorComponent extends SpriteComponent with HasGameRef {
final lines = _splitInLines();
/// Based on how many lines we have, their size and a small
/// offset due to the centering, this calculates where the lines
/// should start on the y axis to be centered
// Calculates vertical offset based on the number of lines of text to be
// displayed. This offset is used to keep the middle of the multi-line text
// at the center of the [ErrorComponent].
final yOffset = ((size.y / 2.2) / lines.length) * 1.5;
for (var i = 0; i < lines.length; i++) {

@ -5,8 +5,7 @@ import 'package:sandbox/common/common.dart';
class ErrorComponentGame extends AssetsGame {
ErrorComponentGame({required this.text});
static const description =
'Shows how ErrorComponents are rendered.';
static const description = 'Shows how ErrorComponents are rendered.';
final String text;

Loading…
Cancel
Save