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

Fix FlxBGSprite render on camera zoom != 1 #3142

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

richTrash21
Copy link
Contributor

additionally skip draw call if alpha is 0

@Geokureli
Copy link
Member

Geokureli commented Jun 10, 2024

can I get a simple scenario that showcases this change?

NVM, made my own

Comment on lines 23 to 25
if (alpha == 0.0)
return;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason for this class to check this when all other FlxSprites do not. This change will only serve to confuse people who expect this to behave exactly like other FlxSprites. I also would not want this change made in FlxSprite, I recommend either setting visible to false, manually to prevent draw calls, or making an extending class in your program that has this change

Suggested change
if (alpha == 0.0)
return;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this wouldn't have had any effect, since the sprite's alpha is typically 1.0, even with a transparent bgColor. Changing the substate's bgColor only changes the sprite's pixel color

@Geokureli
Copy link
Member

Thanks!

@Geokureli Geokureli merged commit 4ed1cfb into HaxeFlixel:dev Jun 10, 2024
11 checks passed
@Geokureli Geokureli added this to the 5.9.0 milestone Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants