mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[flutter] Minor cosmetics.
This commit is contained in:
parent
80b2246d62
commit
d596731ca3
@ -21,13 +21,11 @@ class IkFollowingState extends State<IkFollowing> {
|
|||||||
controller.animationState.setAnimationByName(0, "walk", true);
|
controller.animationState.setAnimationByName(0, "walk", true);
|
||||||
controller.animationState.setAnimationByName(1, "aim", true);
|
controller.animationState.setAnimationByName(1, "aim", true);
|
||||||
}, onAfterUpdateWorldTransforms: (controller) {
|
}, onAfterUpdateWorldTransforms: (controller) {
|
||||||
var worldPosition = crossHairPosition;
|
final worldPosition = crossHairPosition;
|
||||||
if (worldPosition == null) return;
|
if (worldPosition == null) return;
|
||||||
var bone = controller.skeleton.findBone("crosshair");
|
final bone = controller.skeleton.findBone("crosshair")!;
|
||||||
if (bone == null) return;
|
final parent = bone.getParent()!;
|
||||||
var parent = bone.getParent();
|
final position = parent.worldToLocal(worldPosition.dx, worldPosition.dy);
|
||||||
if (parent == null) return;
|
|
||||||
var position = parent.worldToLocal(worldPosition.dx, worldPosition.dy);
|
|
||||||
bone.setX(position.x);
|
bone.setX(position.x);
|
||||||
bone.setY(position.y);
|
bone.setY(position.y);
|
||||||
});
|
});
|
||||||
@ -46,7 +44,7 @@ class IkFollowingState extends State<IkFollowing> {
|
|||||||
body: GestureDetector(
|
body: GestureDetector(
|
||||||
onPanDown: (drag) => _updateBonePosition(drag.localPosition),
|
onPanDown: (drag) => _updateBonePosition(drag.localPosition),
|
||||||
onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
|
onPanUpdate: (drag) => _updateBonePosition(drag.localPosition),
|
||||||
child: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller),
|
child: SpineWidget.fromAsset("assets/spineboy.atlas", "assets/spineboy-pro.skel", controller, alignment: Alignment.centerLeft,),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
|
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.3.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -1597,8 +1597,8 @@ class RegionAttachment extends Attachment<spine_region_attachment> {
|
|||||||
|
|
||||||
Float32List getUVs() {
|
Float32List getUVs() {
|
||||||
final num = _bindings.spine_region_attachment_get_num_uvs(_attachment);
|
final num = _bindings.spine_region_attachment_get_num_uvs(_attachment);
|
||||||
final offset = _bindings.spine_region_attachment_get_uvs(_attachment);
|
final uvs = _bindings.spine_region_attachment_get_uvs(_attachment);
|
||||||
return offset.asTypedList(num);
|
return uvs.asTypedList(num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user