Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by ansimuz

Hi,

I am using the Texture-atlas plugin: https://github.com/dpweberza/ImpactJS-Plugins to create my sprite atlases for my game.

It works fine when running the game but the issue comes when i open a level on weltmeister it throws an "Uncaught TypeError: undefined is not a function " on any entity using the following function in the init block:

this.addTextureAtlasAnim( ig.game.textureAtlas, 'idle', 1, ['EscapePodFemale 1.png', 'EscapePodFemale 2.png'], false);

If i change it to the the ready or the update method of this entity works fine with the exception that the entity is not drawn in the weltmeister for some reason.

Any ideas?

1 decade ago by jessefreeman

Here is the latest version of the plugin that I was using and modified:

https://github.com/gamecook/super-resident-raver-starter-kit/blob/master/Projects/SuperResidentRaverStarterKitWin8/lib/bootstrap/plugins/texture-atlas.js

Once you do this, you'll want to create a class that imports the atlas file in your game like this:

https://github.com/gamecook/super-resident-raver-starter-kit/blob/master/Projects/SuperResidentRaverStarterKitWin8/lib/game/packed-textures.js

From there you need to import the atlas inside of your weltmister config like I do here, see line 5:

https://github.com/gamecook/super-resident-raver-starter-kit/blob/master/Projects/SuperResidentRaverStarterKitWin8/lib/weltmeister/config.js

The key is to correctly imprort the atlas data and tell weltmister about it before the editor loads up or you won't see anything and it will continue to throw errors.

Hope that helps,
Jesse

1 decade ago by ansimuz

Worked! Your examples helped me understand that i needed to do the following:

1. include the texture-atlas.js and the packed textures in weltmeister config

2. Create a TextureAtlas object in my weltmeister.js init.

Thanks Jesse!
Page 1 of 1
« first « previous next › last »