Hello! Please be gentle, I am new to Flutter and Spine Flutter.
If I intialise a character with a custom skin - I cannot seem to set the bounds.
`class SimpleAnimation extends StatelessWidget {
const SimpleAnimation({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
reportLeaks();
var customSkin = Skin("custom-skin");
var data;
var skeleton;
final controller = SpineWidgetController(onInitialized: (controller) {
data = controller.skeletonData;
skeleton = controller.skeleton;
customSkin.addSkin(data.findSkin("Skin1_cowgirl/Skin1_cowgirl_feet")!);
customSkin.addSkin(data.findSkin("Skin1_cowgirl/Skin1_cowgirl_head")!);
customSkin.addSkin(data.findSkin("Skin1_cowgirl/Skin1_cowgirl_lower body")!);
customSkin.addSkin(data.findSkin("Skin1_cowgirl/Skin1_cowgirl_upper")!);
skeleton.setSkin(customSkin);
skeleton.setSlotsToSetupPose();
controller.animationState.setAnimationByName(0, "animation", true);
});
return Scaffold(
body: SpineWidget.fromAsset(
"assets/StressTest2.atlas",
"assets/stress_test2.json",
controller,
fit: BoxFit.contain,
alignment: Alignment.center,
boundsProvider: SkinAndAnimationBounds(skins: ["Skin1_cowgirl/Skin1_cowgirl_head","Skin1_cowgirl/Skin1_cowgirl_lower body"]),
)
);
}
}`
The above works if I select skin parts from the asset file.
But if I replace the boundsProvide to :
boundsProvider: SkinAndAnimationBounds(skins: ["custom-skin"])
I can't see my character. I'm assuming it's off-screen or zero height etc.
What am I doing wrong?