mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 00:17:20 +08:00
Update cicd.yml file on flame_3d to match main. Since we finally updated main, we should require no difference whatsoever on this file anymore. This will require downgrading all the color changes, which is fine. This should never have been a part of flame_3d to begin with. Files were "untouched" by checking out the exact version as they are in main right now (will need to rebase flame_3d to main later). I had to add a couple more files because the files on main had dependencies on changes that are not yet rebased on flame_3d. These extra diffs should disappear when I do the final rebase.
31 lines
708 B
Dart
31 lines
708 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flame/components.dart';
|
|
import 'package:flame/game.dart';
|
|
|
|
class ResizingRectangle extends RectangleComponent {
|
|
ResizingRectangle()
|
|
: super(
|
|
paint: Paint()..color = const Color(0xFFFE4813),
|
|
);
|
|
|
|
@override
|
|
void onGameResize(Vector2 size) {
|
|
super.onGameResize(size);
|
|
|
|
this.size = size * .4;
|
|
}
|
|
}
|
|
|
|
class ResizeExampleGame extends FlameGame {
|
|
ResizeExampleGame() : super(children: [ResizingRectangle()]);
|
|
|
|
static const description = '''
|
|
This example shows how to react to the game being resized.
|
|
|
|
The rectangle will always be 40% of the screen size.
|
|
|
|
Try resizing the window and see the rectangle change its size.
|
|
''';
|
|
}
|