Overlapping sprites - Change of color where there is overlap #3633
Unanswered
Coo-per
asked this question in
Q&A - Sprites
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to display sprites that are overlapping, but where a sprite overlaps- display a different color. To make a sprite appear almost transparent. (See example image below.) I've read through a bunch of the functions and didn't see any functions/examples which would do this.. although I could be missing something.
In my application there will be 1 known sprite that overlaps several other sprites (which maybe rotated) and needs to have the overlap distinguished. I've landed on pushRotated(TFT_eSprite *spr, int16_t angle, uint32_t transp) which allows to "Push a rotated copy of the Sprite to another Sprite." I'm thinking I can inherit the TFT_eSprite class and implement a new version of pushRotated which calls readPixel on both the source AND destination pixel, and either mixes the two colors together or adds a configuration to set the color of overlap via function argument. Because of limited experience with esp32/tft and before I chase a wild goose I wish to know:
-Is this something that exists already that I'm not aware?
-Does the plan above seem to make sense/run fast enough on the hardware?
-Is there a faster approach that would run smoother? (Elements may move on screen, so speed is a concern)
Beta Was this translation helpful? Give feedback.
All reactions