odrick / free-tex-packer

Free texture packer
http://free-tex-packer.com/
MIT License
911 stars 168 forks source link

Cannot read property 'cutWidth' of undefined #19

Closed stathismor closed 5 years ago

stathismor commented 5 years ago

Loading a Phaser exported atlas with Phaser 3 (3.16.2), gives this error:

TextureCrop.js:152 Uncaught TypeError: Cannot read property 'cutWidth' of undefined
    at Image.setFrame (TextureCrop.js:152)
    at Image.setTexture (TextureCrop.js:123)
    at new Image (Image.js:88)
    at GameObjectFactory.image (ImageFactory.js:27)
    at StartMenuScene.create (StartMenuScene.js:12)
    at SceneManager.create (SceneManager.js:610)
    at SceneManager.bootScene (SceneManager.js:498)
    at SceneManager.start (SceneManager.js:1162)
    at SceneManager.processQueue (SceneManager.js:291)
    at SceneManager.update (SceneManager.js:551)
odrick commented 5 years ago

Hi. Phaser 3 atlas format has been changed. I will add support for this format soon.

stathismor commented 5 years ago

That is correct, changing the JSON structure to what Phaser3 expects, works, but it's a pain to do every time. Thanks a lot @odrick!

odrick commented 5 years ago

Phaser 3 format added. Please check here: http://free-tex-packer.com/test/

stathismor commented 5 years ago

Awesome, thanks a lot @odrick !