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: added option for sprites to be imported as a separate texture #581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chqs-git
Copy link

@chqs-git chqs-git commented Jan 9, 2025

Changed the LoadSpriteOpt interface to include the singular boolean. If this values is equal to true the sprite will be loaded as an separate texture, instead of being placed inside a texture sheet where multiple sprites are placed for optimization on texture loads.

These changes should in no way change the default behaviour.

Preview of changes:

loadSprite(
  "player",
  "sprites/player.png",
  {
    singular: true
  }
);

This pull request is for the v4000 version of kaplay because its closer to a feature rather than a fix. If you think this should be included in the v3001 version please comment.

… to stay as a single texture and not be placed inside a texture sheet for optimization.
Copy link

pkg-pr-new bot commented Jan 9, 2025

Open in Stackblitz

npm i https://pkg.pr.new/kaplayjs/kaplay@581

commit: 77f5684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant