spritePackedManager.js 1.4 KB

123456789101112131415161718192021222324252627
  1. import { SpriteManager } from "./spriteManager.js";
  2. import { Texture } from "../Materials/Textures/texture.js";
  3. /**
  4. * Class used to manage multiple sprites of different sizes on the same spritesheet
  5. * @see https://doc.babylonjs.com/features/featuresDeepDive/sprites
  6. */
  7. export class SpritePackedManager extends SpriteManager {
  8. /**
  9. * Creates a new sprite manager from a packed sprite sheet
  10. * @param name defines the manager's name
  11. * @param imgUrl defines the sprite sheet url
  12. * @param capacity defines the maximum allowed number of sprites
  13. * @param scene defines the hosting scene
  14. * @param spriteJSON null otherwise a JSON object defining sprite sheet data
  15. * @param epsilon defines the epsilon value to align texture (0.01 by default)
  16. * @param samplingMode defines the sampling mode to use with spritesheet
  17. * @param fromPacked set to true; do not alter
  18. */
  19. constructor(
  20. /** defines the packed manager's name */
  21. name, imgUrl, capacity, scene, spriteJSON = null, epsilon = 0.01, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) {
  22. //the cellSize parameter is not used when built from JSON which provides individual cell data, defaults to 64 if JSON load fails
  23. super(name, imgUrl, capacity, 64, scene, epsilon, samplingMode, true, spriteJSON);
  24. this.name = name;
  25. }
  26. }
  27. //# sourceMappingURL=spritePackedManager.js.map