Skip to content
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

Use multiple ArtBoards #71

Open
bmatheus91 opened this issue Apr 11, 2019 · 8 comments
Open

Use multiple ArtBoards #71

bmatheus91 opened this issue Apr 11, 2019 · 8 comments

Comments

@bmatheus91
Copy link

bmatheus91 commented Apr 11, 2019

On Flare online tool i can work using multiple Artboards in a single file. But how can i use them on Flutter?

I tried following #10 Fundamentals to Flare, but failed to understand how i could use multiple artboards

@luigi-rosso
Copy link
Contributor

There isn't a way to switch the main artboard through Flutter yet. We will support this soon and show some more advanced features like embedding one artboard into another.

What is it that you are trying to do, we can perhaps give you the option to specify the name of the artboard to display in the FlareActor widget.

@bmatheus91
Copy link
Author

bmatheus91 commented Apr 11, 2019

What is it that you are trying to do, we can perhaps give you the option to specify the name of the artboard to display in the FlareActor widget.

I'm trying to change a pulsing button whenever my state changes. This pulsing button changes its SVG Icon, color and Animation.

  • Already tried to make one artboard to rule them all. Changing in each animation SVG Icon and color. Not very good looking.
  • I've seen on Flare manual that you can use one file with multiple artboards so i created a file (current one), with 5 ArtBoards (each one with a specific SVG and Animation).

@tafelito
Copy link

tafelito commented Aug 8, 2019

when working on a bottom nav icons animations, I could see using different artboards for every single icon instead of creating a different flare file.

Will this be a correct use case?

Also, is there any best practices on what the size of the artboard should be? Does it have any implications at all? For example, if I have an artboard of 1024x1024 and an icon of 20x20, should I make the artboard 20x20 as well? I usually try to make the images greater so I can see them better when I zoom in, as the zoom only allows to go up to 800%

@luigi-rosso
Copy link
Contributor

That's a good use case!

The size of the artboard matters as it's used as the bounds of the content when it's sized to fit at runtime. If you tell the widget to use the intrinsic size of the artboard, it'll also size the widget to the dimensions of the selected artboard. We now support using different artboards. You can provide the name of the artboard to the FlutterActor widget.

@tafelito
Copy link

tafelito commented Aug 8, 2019 via email

@luigi-rosso
Copy link
Contributor

You can also translate the content on the art board by tweaking the origin. 0, 0 places the origin on the top right, 1, 1 bottom left, 0.5, 0.5 center, etc. This will affect all transformations and animations.

@tafelito
Copy link

tafelito commented Aug 9, 2019

what about copying one shape with animations from one artboard to another? is that possible?

@gctommy
Copy link

gctommy commented Sep 3, 2019

We now support using different artboards. You can provide the name of the artboard to the FlutterActor widget.

Having trouble with this, @luigi-rosso could you provide an example of what to do with the controllers when there are 2 or more artboards?

For example, I currently have one .flr file with two artboards containing one animation each and both are non-looping animations, calling the widgets like this:

FlareActor('assets/my_animation.flr',
    isPaused: _isPaused,
    fit: BoxFit.contain,
    alignment: Alignment.center,
    animation: 'animation1',
    artboard: 'Artboard1',
    controller: this,
),
FlareActor('assets/my_animation.flr',
    isPaused: _isPaused,
    fit: BoxFit.contain,
    alignment: Alignment.center,
    animation: 'animation2',
    artboard: 'Artboard2',
    controller: this,
),

This will cause a duration null error since both widgets are referencing the same controller. If I omit the controllers, then the animations only run once and does not loop. If I edit the .flr file animations to loop or provide my own separate FlareControls for the controller, then the advance() function isn't called at all? Please help, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants