Skip to content

feat: allow slice9'ed drawSprite#1036

Open
dragoncoder047 wants to merge 15 commits into
kaplayjs:masterfrom
dragoncoder047:slice9drawsprite
Open

feat: allow slice9'ed drawSprite#1036
dragoncoder047 wants to merge 15 commits into
kaplayjs:masterfrom
dragoncoder047:slice9drawsprite

Conversation

@dragoncoder047

Copy link
Copy Markdown
Contributor

allow slice9'ed sprites in drawSprite()

Summary

  • Changeloged

Comment thread src/gfx/draw/drawSprite.ts Outdated
@lajbel

lajbel commented Feb 18, 2026

Copy link
Copy Markdown
Member

Wouldn't be better to create a separated function like draw9SliceSprite()?

@dragoncoder047

Copy link
Copy Markdown
Contributor Author

Wouldn't be better to create a separated function like draw9SliceSprite()?

possibly, but then it would make sense to also have one for drawTiledSprite(), etc., idk if it's worth it.

@lajbel

lajbel commented Feb 18, 2026

Copy link
Copy Markdown
Member

I think it does. We reduce overhead in sprite drawing functions, what do you think @mflerackers?

@dragoncoder047

Copy link
Copy Markdown
Contributor Author

i think it conflicts with the way sprites are defined, that is, the slice9 parameters are stored in the sprite metadata, so what would happen if you called draw9SliceSprite with a sprite with no slice9 metadata. Or vice versa

Sign up for free to 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