mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[flutter] Fix up dress up
This commit is contained in:
parent
7bb1d65bfe
commit
8f6de4b159
@ -22,9 +22,12 @@ class DressUpState extends State<DressUp> {
|
||||
for (var skin in drawable.skeletonData.getSkins()) {
|
||||
var recorder = ui.PictureRecorder();
|
||||
var canvas = Canvas(recorder, const Rect.fromLTWH(0, 0, thumbnailSize, thumbnailSize));
|
||||
canvas.drawRect(Rect(0, 0, 200, 200), ColorP)
|
||||
var paint = Paint()
|
||||
..color = ui.Color(0xff995588)
|
||||
..style = PaintingStyle.fill;
|
||||
canvas.drawRect(Rect.fromLTWH(0, 0, 200, 200), paint);
|
||||
var imageData = await (await recorder.endRecording().toImage(thumbnailSize.toInt(), thumbnailSize.toInt())).toByteData(format: ui.ImageByteFormat.png);
|
||||
_skinImages.add(Image.memory(imageData!.buffer.asUint8List()));
|
||||
_skinImages.add(Image.memory(imageData!.buffer.asUint8List(), fit: BoxFit.none));
|
||||
}
|
||||
_drawable = drawable;
|
||||
setState(() {});
|
||||
|
||||
@ -67,7 +67,7 @@ class ExampleSelector extends StatelessWidget {
|
||||
),
|
||||
spacer,
|
||||
ElevatedButton(
|
||||
child: const Text('Skins'),
|
||||
child: const Text('Dress Up'),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user