mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-31 00:48:47 +08:00
chore: Remove 1.8.0 deprecations (#2538)
Removes all the deprecated methods before 1.8.0 release.
This commit is contained in:
@ -25,8 +25,14 @@ class JoystickAdvancedExample extends FlameGame with HasCollisionDetection {
|
||||
late final TextComponent speedText;
|
||||
late final TextComponent directionText;
|
||||
|
||||
final world = World();
|
||||
late final CameraComponent cameraComponent;
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
cameraComponent = CameraComponent(world: world);
|
||||
addAll([cameraComponent, world]);
|
||||
|
||||
final image = await images.load('joystick.png');
|
||||
final sheet = SpriteSheet.fromColumnsAndRows(
|
||||
image: image,
|
||||
@ -158,11 +164,11 @@ class JoystickAdvancedExample extends FlameGame with HasCollisionDetection {
|
||||
speedText = TextComponent(
|
||||
text: 'Speed: 0',
|
||||
textRenderer: regular,
|
||||
)..positionType = PositionType.viewport;
|
||||
);
|
||||
directionText = TextComponent(
|
||||
text: 'Direction: idle',
|
||||
textRenderer: regular,
|
||||
)..positionType = PositionType.viewport;
|
||||
);
|
||||
|
||||
final speedWithMargin = HudMarginComponent(
|
||||
margin: const EdgeInsets.only(
|
||||
@ -185,8 +191,8 @@ class JoystickAdvancedExample extends FlameGame with HasCollisionDetection {
|
||||
add(buttonComponent);
|
||||
add(spriteButtonComponent);
|
||||
add(shapeButton);
|
||||
add(speedWithMargin);
|
||||
add(directionWithMargin);
|
||||
cameraComponent.viewport.add(speedWithMargin);
|
||||
cameraComponent.viewport.add(directionWithMargin);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user