Skip to content

Add new transform to truncate a sprite to the default sprite size #39

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
m-ender opened this issue Feb 21, 2022 · 2 comments
Open

Add new transform to truncate a sprite to the default sprite size #39

m-ender opened this issue Feb 21, 2022 · 2 comments
Labels
feature New feature or request question Further information is requested sprite manipulations copying and transforming sprites syntax/language Concerns the language or its syntax

Comments

@m-ender
Copy link
Collaborator

m-ender commented Feb 21, 2022

Could be called truncate, trim or clip. I'm thinking it might also be nice to have an optional directional parameter, which would only truncate the sprite in that direction. Offsets for custom cutoff points don't need to be specified because they could be realised by translating, truncating, translating instead.

I'm not 100% sure how this should interact with translated sprites, but it would probably keep the offset unchanged but take it into account when deciding where to cut off the sprite.

@ClementSparrow ClementSparrow added feature New feature or request question Further information is requested syntax/language Concerns the language or its syntax labels Feb 21, 2022
@ClementSparrow
Copy link
Owner

I will need to think a little bit about the use cases and what is the best way to do this.

@m-ender
Copy link
Collaborator Author

m-ender commented Feb 21, 2022

A couple of use cases (mostly reproduced from our Discord conversation, but to have them here for reference):

  • Implementing a marquee/number lock/one-armed bandit style effect, where characters move through a cell but should be cut off at the edges they appear/disappear through.
  • Jigsaw-style games where you need to assemble a large image from cell-sized pieces. You could define the target image as a single large sprite and then generate the pieces by translating and truncating the large sprite.

@ClementSparrow ClementSparrow added the sprite manipulations copying and transforming sprites label Jul 22, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature New feature or request question Further information is requested sprite manipulations copying and transforming sprites syntax/language Concerns the language or its syntax
Projects
None yet
Development

No branches or pull requests

2 participants