Phaser.Component. Destroy

new Destroy()

The Destroy component is responsible for destroying a Game Object.

Source - gameobjects/components/Destroy.js, line 12

Members

<readonly> destroyPhase :boolean

As a Game Object runs through its destroy method this flag is set to true, and can be checked in any sub-systems or plugins it is being destroyed from.

Source - gameobjects/components/Destroy.js, line 22

Methods

destroy(destroyChildren, destroyTexture)

Destroys the Game Object. This removes it from its parent group, destroys the input, event and animation handlers if present and nulls its reference to game, freeing it up for garbage collection.

If this Game Object has the Events component it will also dispatch the onDestroy event.

You can optionally also destroy the BaseTexture this Game Object is using. Be careful if you've more than one Game Object sharing the same BaseTexture.

Parameters:
Name Type Argument Default Description
destroyChildren boolean <optional>
true

Should every child of this object have its destroy method called as well?

destroyTexture boolean <optional>
false

Destroy the BaseTexture this Game Object is using? Note that if another Game Object is sharing the same BaseTexture it will invalidate it.

Source - gameobjects/components/Destroy.js, line 37
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Thu Feb 18 2016 14:40:59 GMT+0000 (GMT Standard Time) using the DocStrap template.

快捷菜单

注意:只有登录才能全文翻译,每个新用户赠送300会员币。
赚取方法:文章评论+1000,分享网站截图给站长+3000,另充10元+100万会员币
支持一下记得截图给站长!

VIP限时免费阅读!登录可得1万币尽情中文阅读!


记得CTRL+D收藏!
站长微信:
支持自学php网
如有问题,记得强刷一下.

  • destroyPhase :boolean - 属性
  • destroy(destroyChildren, destroyTexture) - 方法