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

feat: Implement Sprite Tint #2326

Merged
merged 6 commits into from
Jun 4, 2022
Merged

feat: Implement Sprite Tint #2326

merged 6 commits into from
Jun 4, 2022

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented May 31, 2022

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

This PR adds the ability to tint sprites by a color.

const imageSource = new ex.ImageSource('./path/to/image.png');
await imageSource.load();
const sprite = imageSource.toSprite();
sprite.tint = ex.Color.Green;

In this example the blocks are tinted green

image

Changes:

  • Add tint property to ex.Sprite
  • Updates graphics context and image renderer to support the tint

@github-actions github-actions bot added the enhancement Label applied to enhancements or improvements to existing features label May 31, 2022
@eonarheim eonarheim merged commit de8452c into main Jun 4, 2022
@eonarheim eonarheim deleted the feature/sprite-tint branch June 4, 2022 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Label applied to enhancements or improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant