-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Objects outside the ArtBoard are visible #85
Comments
Yes I enabled "Clip Contents" in the Artboard of my Flare file. Now I thought maybe I overwrite it in Flutter in the Flutter Actor Artboard. But there clipContents is set to true as well: This is my Flare file: https://www.2dimensions.com/a/optimygmbh/files/flare/hollywood/embed. |
Hey @jcairo, I've tested your file locally and I don't see the issue on my side. |
Hey Umberto. Not sure how much you want here. I've added the code for the widget where the problem is. I can also provide you with a Flutter repo if that is easier? class PlayButton extends StatefulWidget {
final Player player;
const PlayButton({
Key key,
this.player,
}) : super(key: key);
@override
_PlayButtonState createState() => _PlayButtonState();
}
class _PlayButtonState extends State<PlayButton> with TickerProviderStateMixin {
String _animationName = "PlayToPause";
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(border: Border.all(color: Colors.black)),
height: 100,
width: 100,
child: FlatButton(
child: FlareActor(
"assets/animations/anim.flr",
fit: BoxFit.fill,
animation: _animationName,
sizeFromArtboard: true,
),
onPressed: () {
var tempName;
if (_animationName == "PlayToPause") {
tempName = "PauseToPlay";
} else {
tempName = "PlayToPause";
}
setState(() {
_animationName = tempName;
});
},
));
return IconButton(
onPressed: widget.player.fileIsLoaded ? () => widget.player.play() : null,
icon: Icon(
FontAwesomeIcons.playCircle,
color: Colors.black,
),
iconSize: kIconSize,
);
}
} |
With your file above and this configuration, everything still looks fine on my side. |
It looks like the Flare runtime may not be applying the final frame of the animation. Is the behavior consistent amongst re-runs or is it always at a slightly different spot? Does the behavior change in release/debug mode? |
Hey Luigi, I've now tried in release mode and i'm still seeing the same problem. I don't think it's just the final frame. Using this Same code as above but with boxfit.contain class PlayButton extends StatefulWidget {
final Player player;
const PlayButton({
Key key,
this.player,
}) : super(key: key);
@override
_PlayButtonState createState() => _PlayButtonState();
}
class _PlayButtonState extends State<PlayButton> with TickerProviderStateMixin {
String _animationName = "PlayToPause";
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(border: Border.all(color: Colors.black)),
height: 100,
width: 100,
child: FlatButton(
child: FlareActor(
"assets/animations/PlayPause.flr",
fit: BoxFit.contain,
animation: _animationName,
sizeFromArtboard: true,
),
onPressed: () {
var tempName;
if (_animationName == "PlayToPause") {
tempName = "PauseToPlay";
} else {
tempName = "PlayToPause";
}
setState(() {
_animationName = tempName;
});
},
));
}
}
|
TL;DR: Update your pubspec |
Awesome! Great tool you have here guys! Thanks for being so responsive. |
Is it a setting in Flare or Flutter, that drawing elements only are visible inside the ArtBoard and not outside?
For example I'm having an animation with clouds flying from left to right. They start at left outside the ArtBoard and end right outside of the ArtBoard. But I can see the clouds "waiting" in the Flutter App. And how you can see the sun is visible as well outside the ArtBoard:
The text was updated successfully, but these errors were encountered: