mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
26 lines
825 B
Dart
26 lines
825 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:esotericsoftware_spine_flutter/spine_flutter.dart';
|
|
|
|
class DebugRendering extends StatelessWidget {
|
|
const DebugRendering({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
reportLeaks();
|
|
|
|
const debugRenderer = DebugRenderer();
|
|
final controller = SpineWidgetController(
|
|
onInitialized: (controller) {
|
|
controller.animationState.setAnimationByName(0, "walk", true);
|
|
},
|
|
onAfterPaint: (controller, canvas, commands) {
|
|
debugRenderer.render(controller.drawable, canvas, commands);
|
|
}
|
|
);
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('Debug Renderer')),
|
|
body: SpineWidget.asset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller),
|
|
);
|
|
}
|
|
} |