Skip to content

Improved behavior of "visible" setter and getter properties in BasicSprite. - #2029

Merged
einarf merged 5 commits into
pythonarcade:developmentfrom
DragonMoffon:sprite-alpha-fix
Mar 23, 2024
Merged

Improved behavior of "visible" setter and getter properties in BasicSprite.#2029
einarf merged 5 commits into
pythonarcade:developmentfrom
DragonMoffon:sprite-alpha-fix

Conversation

@DragonMoffon

Copy link
Copy Markdown
Collaborator

This is so the alpha state is stored when setting visibility. Originally, it overrode the alpha, which was stinky.

This is so the alpha state is stored when setting visibility. originally it overrode the alpha which was stinky.
@DragonMoffonDragonMoffon changed the title add visible flag and strip out changing alpha when setting visible.Add "visible" flag to BaseSpriteMar 19, 2024

@pushfoopushfoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TL;DR: There are nasty, subtle details which need changes to take care of.

The general changes are good, however. I also think we might have uncovered room for improvement in Color.from_iterable since we leave an unpack underflow uncaught, and it results in a somewhat vague exception.

Comment threadarcade/sprite/base.py
Comment threadtests/unit/sprite/test_sprite.py
Comment threadtests/unit/sprite/test_sprite.py
Comment threadtests/unit/sprite/test_sprite.py
Comment threadarcade/sprite/base.py
Comment threadarcade/sprite/base.py Outdated
@DragonMoffonDragonMoffon changed the title Add "visible" flag to BaseSpriteImproved behavior or "visible" setter and getter properties in BasicSprite.Mar 20, 2024
@DragonMoffonDragonMoffon changed the title Improved behavior or "visible" setter and getter properties in BasicSprite.Improved behavior of "visible" setter and getter properties in BasicSprite.Mar 20, 2024

@pushfoopushfoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should fix this while we're here.

Comment threadarcade/sprite/base.py Outdated
DragonMoffonand others added 2 commits March 21, 2024 16:33
* Correct and expand docstring for BasicSprite.visible
* Add comment explaining that SpriteList handles the alpha/visible interaction
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@DragonMoffon@pushfoo@einarf