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

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

Loading…
Cancel
Save