Closed nartawak closed 5 years ago
Hey nartawak, thanks for the report!
I've run your file locally and it seems to work -- you're right though, its extension needs to be .nima
for it to work.
I see a few problems with your code though, and it's mostly about the Flutter layout you're trying to use.
FIrst of all, in Flutter it's easier to use a Scaffold
to wrap your main layout so that it has a basic layout structure.
Secondly, your Column isn't being bound by anything, so it's trying to take up Infinity
pixels in height, which generates an error.
Lastly, you can't use an "idle" animation, because your character doesn't have one with that name.
You can try something like this to have some visual feedback:
Scaffold(
body: Column(
children:
[
Container(
width:100,
height: 100,
child: NimaActor("assets/testBZ",
alignment: Alignment.center,
fit: BoxFit.contain,
animation: "Arm"
)
),
Image.asset('assets/testBZ.png',
width: 100,
height: 100
)
]
)
);
Hi @umberto-sonnino, thanks for your answer. I try to implements your solution and rename the file testBZ.nma to testBZ.nima. The same error is throwing.
You can find the sample here
I tried the build()
method from your PR and it seems to be working correctly on my end.
Is the error you're getting the same from your first post?
@umberto-sonnino Sorry for the late answer, I didn't have much time on this subject. I update flutter on my maschine and the issue is solved ..... So i close this issue, thanks for your help ;)
Just thought to comment that I had same issue and was fixed after renaming to Nima file name from .nma to .nima and updating the asset name as given below) and performed flutter clean before re-building. _
new NimaActor("assets/NN.nima", alignment:Alignment.center, fit:BoxFit.fill, animation: "NA"),
_
You can find my Flutter sample project here and the Nima sample here
I follow the steps define in the documentation
As you can see, i add an Image widget for testing that the png asset in accessible in context, and i read the nma file too, it works.
Stacktrace