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

SpriteComponent doesn't auto-resize #2419

Closed
ufrshubham opened this issue Mar 20, 2023 · 1 comment · Fixed by #2430
Closed

SpriteComponent doesn't auto-resize #2419

ufrshubham opened this issue Mar 20, 2023 · 1 comment · Fixed by #2430
Assignees
Labels

Comments

@ufrshubham
Copy link
Collaborator

Current bug behavior

If sprite of a SpriteComponent is set or updated after construction of the component, the size of the component does not update.

Expected behavior

Ideally the size of SpriteComponent should be automatically updated by default. Additionally a an option can be provided to turn this resizing off by setting a flag in SpriteComponent.

Steps to reproduce

Setting up a sprite component like this will make it render with zero size:

final spriteComponent = SpriteComponent();
spriteComponent.sprite = await Sprite.load('arrow_up.png');
add(spriteComponent);

Flutter doctor output

NA

More environment information

Flame version: 1.6.0
Platform affected: All

Log information

Enter log information in this code block

NA

More information

I can work on this.

@ufrshubham ufrshubham added the bug label Mar 20, 2023
@spydon
Copy link
Member

spydon commented Mar 20, 2023

I assigned you to the issue :)
I guess this is the same in SpriteAnimationComponent?

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

Successfully merging a pull request may close this issue.

2 participants