Phaser.Component. InWorld

new InWorld()

The InWorld component checks if a Game Object is within the Game World Bounds. An object is considered as being "in bounds" so long as its own bounds intersects at any point with the World bounds. If the AutoCull component is enabled on the Game Object then it will check the Game Object against the Camera bounds as well.

Source - gameobjects/components/InWorld.js, line 14

Members

checkWorldBounds :boolean

If this is set to true the Game Object checks if it is within the World bounds each frame.

When it is no longer intersecting the world bounds it dispatches the onOutOfBounds event.

If it was previously out of bounds but is now intersecting the world bounds again it dispatches the onEnterBounds event.

It also optionally kills the Game Object if outOfBoundsKill is true.

When checkWorldBounds is enabled it forces the Game Object to calculate its full bounds every frame.

This is a relatively expensive operation, especially if enabled on hundreds of Game Objects. So enable it only if you know it's required, or you have tested performance and find it acceptable.

Source - gameobjects/components/InWorld.js, line 92

<readonly> inWorld :boolean

Checks if the Game Objects bounds are within, or intersect at any point with the Game World bounds.

Source - gameobjects/components/InWorld.js, line 114

outOfBoundsKill :boolean

If this and the checkWorldBounds property are both set to true then the kill method is called as soon as inWorld returns false.

Source - gameobjects/components/InWorld.js, line 100

Methods

<static> preUpdate()

The InWorld component preUpdate handler. Called automatically by the Game Object.

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

快捷菜单

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

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


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

  • checkWorldBounds :boolean - 属性
  • inWorld :boolean - 属性
  • outOfBoundsKill :boolean - 属性
  • preUpdate() - 方法