Component.PhysicsBody#body

body : Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | null body is the Game Objects physics body. Once a Game Object is enabled for physics you access all associatedproperties and methods via it. By default Game Objects won't add themselves to any physics system and their body property will be null. To enable this Game Object for physics you need to call game.physics.enable(object, system) where object is this objectand system is the Physics system you are u

Component.Overlap#overlap()

overlap(displayObject) → {boolean} Checks to see if the bounds of this Game Object overlaps with the bounds of the given Display Object,which can be a Sprite, Image, TileSprite or anything that extends those such as Button or provides a getBounds method and result. This check ignores the hitArea property if set and runs a getBounds comparison on both objects to determine the result. Therefore it's relatively expensive to use in large quantities, i.e. with lots of Sprites at a high frequency.I

Component.LoadTexture#setFrame()

setFrame(frame) Sets the texture frame the Game Object uses for rendering. This is primarily an internal method used by loadTexture, but is exposed for the use of plugins and custom classes. Parameters Name Type Description frame Phaser.Frame The Frame to be used by the texture. Source code: gameobjects/components/LoadTexture.js (Line 155)

Component.LoadTexture#resizeFrame()

resizeFrame(parent, width, height) Resizes the Frame dimensions that the Game Object uses for rendering. You shouldn't normally need to ever call this, but in the case of special texture types such as Video or BitmapDatait can be useful to adjust the dimensions directly in this way. Parameters Name Type Description parent object The parent texture object that caused the resize, i.e. a Phaser.Video object. width integer The new width of the texture. height integer The new height of the

Component.LoadTexture#resetFrame()

resetFrame() Resets the texture frame dimensions that the Game Object uses for rendering. Source code: gameobjects/components/LoadTexture.js (Line 232)

Component.LoadTexture#loadTexture()

loadTexture(key, frame, stopAnimation) Changes the base texture the Game Object is using. The old texture is removed and the new one is referenced or fetched from the Cache. If your Game Object is using a frame from a texture atlas and you just wish to change to another frame, then see the frame or frameName properties instead. You should only use loadTexture if you want to replace the base texture entirely. Calling this method causes a WebGL texture update, so use sparingly or in low-intensi

Component.LoadTexture#frameName

frameName : string Gets or sets the current frame name of the texture being used to render this Game Object. To change the frame set frameName to the name of the new frame in the texture atlas you wish this Game Object to use,for example: player.frameName = "idle". If the frame name given doesn't exist it will revert to the first frame found in the texture and throw a console warning. If you are using a sprite sheet then you should use the frame property instead. If you wish to fully replace

Component.LoadTexture#frame

frame : integer Gets or sets the current frame index of the texture being used to render this Game Object. To change the frame set frame to the index of the new frame in the sprite sheet you wish this Game Object to use,for example: player.frame = 4. If the frame index given doesn't exist it will revert to the first frame found in the texture. If you are using a texture atlas then you should use the frameName property instead. If you wish to fully replace the texture being used see loadTextur

Component.LifeSpan.preUpdate()

<static> preUpdate() The LifeSpan component preUpdate handler.Called automatically by the Game Object. Source code: gameobjects/components/LifeSpan.js (Line 20)

Component.LifeSpan#revive()

revive(health) → {PIXI.DisplayObject} Brings a 'dead' Game Object back to life, optionally resetting its health value in the process. A resurrected Game Object has its alive, exists and visible properties all set to true. It will dispatch the onRevived event. Listen to events.onRevived for the signal. Parameters Name Type Argument Default Description health number <optional> 100 The health to give the Game Object. Only set if the GameObject has the Health component. Returns PI