* Destroy.
()
| 251 | * Destroy. |
| 252 | */ |
| 253 | destroy() { |
| 254 | for (let i = 0; i < this.textures.length; i++) { |
| 255 | this.textures[i].destroy(true); |
| 256 | this.sprites[i].destroy(); |
| 257 | } |
| 258 | |
| 259 | for (const framebuffer of Object.values(this.framebuffers)) { |
| 260 | framebuffer.renderTexture.destroy(); |
| 261 | framebuffer.dispose(); |
| 262 | } |
| 263 | |
| 264 | this.textures = null; |
| 265 | this.sprites = null; |
| 266 | this.framebuffers = null; |
| 267 | this.destroyed = true; |
| 268 | } |
| 269 | |
| 270 | /** |
| 271 | * Render the display object. |