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

If the opacity of an Actor's drawing/color is 0, don't draw the actor #875

Closed
jedeen opened this issue Aug 16, 2017 · 6 comments · Fixed by #1279
Closed

If the opacity of an Actor's drawing/color is 0, don't draw the actor #875

jedeen opened this issue Aug 16, 2017 · 6 comments · Fixed by #1279
Labels
good first issue good for people new to open source and Excalibur optimization Applied to any issue dealing with performance optimizations

Comments

@jedeen
Copy link
Member

jedeen commented Aug 16, 2017

Context

If an Actor's currentDrawing or color has it's opacity set to 0, the Actor will still draw transparent pixels to the canvas.

Proposal

Set Actor.visible to false if the Actor's drawing or color is 100% transparent, to prevent transparent pixels from being drawn.

@jedeen jedeen added the optimization Applied to any issue dealing with performance optimizations label Aug 16, 2017
@jedeen jedeen added this to the vNext milestone Aug 16, 2017
@eonarheim eonarheim assigned jedeen and unassigned jedeen Sep 12, 2017
@eonarheim eonarheim added the good first issue good for people new to open source and Excalibur label Oct 25, 2018
@tskull01
Copy link

tskull01 commented Jan 8, 2019

I would like to handle this.

tskull01 added a commit to tskull01/Excalibur that referenced this issue Jan 8, 2019
If the opacity of an Actor's drawing/color is 0, don't draw the actor.
@eonarheim
Copy link
Member

@tskull01 Go for it, I recommend refactoring visible to a getter/setter pair and implementing the logic in the setter.

tskull01 added a commit to tskull01/Excalibur that referenced this issue Jan 9, 2019
tskull01 added a commit to tskull01/Excalibur that referenced this issue Jan 9, 2019
@eonarheim
Copy link
Member

@tskull01 let me know if you would like any assistance

@Moonstrous
Copy link

@eonarheim Can i handle this issue ?

@SirKitboard
Copy link
Contributor

Is this issue still open?
I see that there were commits related to it but the issue is marked as openn

@eonarheim
Copy link
Member

@SirKitboard It is! All yours!

There are a couple approaches, hooking into the internal _postupdate and checking the Actor's color opacity then setting visible or not may make the most sense.

eonarheim pushed a commit that referenced this issue Oct 8, 2019
…e actor (#1279)

Closes #875

## Changes:

- Set visible to false if opacity is 0 during update
@jedeen jedeen modified the milestones: vNext, 0.24.0 Release Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue good for people new to open source and Excalibur optimization Applied to any issue dealing with performance optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants