Its literally an empty class that does nothing. I have no association with this lol. <3
Buuuuuuut, if everyone really really needs this to happen Ill bite the bullet and take responsibility on making this thing actually do something. Was kind of hoping @pavul was going to finish what he was doing to make the normal Sprite manager work with an atlas.json then we where going to migrate that to the manager class.
No you are good brother, just seeing if you were able to make them do what you needed. If you had I was going to reference your code and make the packed manager work like whatever you ended up doing.
i implemented a workaround i could not use SpritePackedManager features, i hope you can address that to fix it in the near future, i will gladly test it, btw my workaround was to implement particles for the explosions, but i think it would be better just changing the animation.
i know babylon is for 3d, but i am trying to make a 2D simple scrolling shooter to learn the library myself and maybe create a tutorial for 2D games using babylon.js
I looked at this again and understand more about the SpritePackedManager now, and I don’t think it is intended to support the kind of animations you want.
It uses multiple SpriteMap instances that reference the same image and atlas json. You can’t make the SpriteMap width zero to make it disappear so it can be replaced by the explosion, but you can move it off the screen by setting its position to a very large number (Infinity in the example).
I would not recommend using the spriteMap for this. It only support square sprites really.
but if you where going to use it, you do not need to have two for the one sprite. You could even use layers to make sure the “enemy” sticks around for a second.
if you would like to play different animations from an atlas image like i have, you will be forced to add every frame as i did with enebullet_f1 and enebullet_f2, it does not matter if you defines the frames inside the object cause will be ignored, i think that is confusing (but at the end i think i am the only that is trying to make a 2D game with a 3d tool ).
that is how SpritePackedManager treats the image atlas, like a single big sprite with a lot of frames ( for that big sprite ).
in the code SpritePackedManager is a wrapper for SpriteManager, it just set packed to true and pass it JSON file data, nothing more. ( i think someboyd mentioned that time ago above ), but due all the properties are private is not possible to set them with new values cause we don’t have setters, i am refering to:
private _cellData: any;
/** Array of sprite names from JSON sprite data file */
private _spriteMap: Array<string>;
/** True when packed cell data from JSON file is ready*/
private _packedAndReady: boolean = false;
private _textureContent: Nullable<Uint8Array>;
private _onDisposeObserver: Nullable<Observer<SpriteManager>>;
private _fromPacked: boolean;
from spriteManager.ts
that’s it to me guys, i hope this can be of some help. thanks in advance.