()
| 340 | |
| 341 | // called when the layer is removed from the game world or a container |
| 342 | onDeactivateEvent() { |
| 343 | // cancel all event subscriptions |
| 344 | off(VIEWPORT_ONCHANGE, this.updateLayer, this); |
| 345 | off(VIEWPORT_ONRESIZE, this.resize, this); |
| 346 | off(LEVEL_LOADED, this.updateLayer, this); |
| 347 | off(ONCONTEXT_RESTORED, this.createPattern, this); |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Destroy function |