phaser
phaser copied to clipboard
Error when instantiating a button with a texture key not in the cache
Possible regression or unintended breaking change
- Earliest occurrence: Phaser 2.3.0
- Prior Behaviour (2.2.2): console warning, but no error whatsoever.
- Stack trace:
Uncaught TypeError:
Cannot read property 'getFrameByName' of null
Object.defineProperty.set
Phaser.Component.LoadTexture.frameName.set
Phaser.Button.changeStateFrame
Phaser.Button.setStateFrame
Phaser.Button.setFrames
new Phaser.Button
- Repro: http://plnkr.co/edit/PPEdRHcn6mrN8ZQNvLiN
You can check by swapping phaser versions in the provided plunkr.
It's probably intended behaviour (My use case was not wanting to load textures while unit testing my components), but I found no documented change about it.
I have the same issue. Any news about it?
Looks like the guard added to the frame setter wasn't applied to frameName. Now done, should solve this issue.