implement CanvasSprite class #1020
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the beginnings of a new feature that, among other possibilities, allows for text that changes mid-game to be drawn as if it was printed on a card. Really, this is far more broad than that, and you can render anything to the canvas if you'd like.
My usage so far has entailed treating it like a shared sprite (similar to how seal sprites behave) and directly rendering to the canvas with
love.graphicscalls, but ideally this feature would come with some utility functions to handle the rendering for the user. That said, I'm a little stupid so I'm going to push this as a draft PR now and shamelessly let other people suggest how the utility functions should work :3 It also probably needs tweaking/adjustments/etc but I'd rather get it out now so I'm not flailing around in the darkDemonstration, using my dice mod (the timing is wrong but the demonstration still works):
https://github.com/user-attachments/assets/1c4d4ab8-5936-488d-8d1b-b84a5139b15a
An example of how to use the CanvasSprite is in the dev branch of the aforementioned dice mod, primarily in the DrawStep in the main HighRoller.lua file (the CanvasSprites are created in the
injectfunction that each die object has)Additional Info: