Class: Core

Phaser.Component. Core

new Core()

Core Component Features.

Source:
src/gameobjects/components/Core.js line 12

Members

<static> skipTypeChecks : boolean

Skip type checks in init.

Type:
  • boolean
Source:
src/gameobjects/components/Core.js line 19

animations : Phaser.AnimationManager

If the Game Object is enabled for animation (such as a Phaser.Sprite) this is a reference to its AnimationManager instance. Through it you can create, play, pause and stop animations.

Type:
Source:
src/gameobjects/components/Core.js line 218
See:

<protected> components : object

The components this Game Object has installed.

Type:
  • object
Source:
src/gameobjects/components/Core.js line 192

data : Object

An empty Object that belongs to this Game Object. This value isn't ever used internally by Phaser, but may be used by your own code, or by Phaser Plugins, to store data that needs to be associated with the Game Object, without polluting the Game Object directly.

Type:
  • Object
Default Value:
  • {}
Source:
src/gameobjects/components/Core.js line 185

debug : boolean

A debug flag designed for use with Game.enableStep.

Type:
  • boolean
Source:
src/gameobjects/components/Core.js line 243

events : Phaser.Events

All Phaser Game Objects have an Events class which contains all of the events that are dispatched when certain things happen to this Game Object, or any of its components.

Type:
Source:
src/gameobjects/components/Core.js line 210
See:

exists : boolean

Controls if this Game Object is processed by the core game loop. If this Game Object has a physics body it also controls if its physics body is updated or not. When exists is set to false it will remove its physics body from the physics world if it has one. It also toggles the visible property to false as well.

Setting exists to true will add its physics body back in to the physics world, if it has one. It will also set the visible property to true.

Type:
  • boolean
Source:
src/gameobjects/components/Core.js line 309

<readonly> fresh : boolean

A Game Object is considered fresh if it has just been created or reset and is yet to receive a renderer transform update. This property is mostly used internally by the physics systems, but is exposed for the use of plugins.

Type:
  • boolean
Source:
src/gameobjects/components/Core.js line 273

game : Phaser.Game

A reference to the currently running Game.

Type:
Source:
src/gameobjects/components/Core.js line 167

key : string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture

The key of the image or texture used by this Game Object during rendering. If it is a string it's the string used to retrieve the texture from the Phaser Image Cache. It can also be an instance of a RenderTexture, BitmapData, Video or PIXI.Texture. If a Game Object is created without a key it is automatically assigned the key __default which is a 32x32 transparent PNG stored within the Cache. If a Game Object is given a key which doesn't exist in the Image Cache it is re-assigned the key __missing which is a 32x32 PNG of a green box with a line through it.

Type:
Source:
src/gameobjects/components/Core.js line 228

name : string

A user defined name given to this Game Object. This value isn't ever used internally by Phaser, it is meant as a game level property.

Type:
  • string
Source:
src/gameobjects/components/Core.js line 175

pendingDestroy : boolean

A Game Object is that is pendingDestroy is flagged to have its destroy method called on the next logic update. You can set it directly to allow you to flag an object to be destroyed on its next update.

This is extremely useful if you wish to destroy an object from within one of its own callbacks such as with Buttons or other Input events.

Type:
  • boolean
Source:
src/gameobjects/components/Core.js line 284

<readonly> previousPosition : Phaser.Point

The position the Game Object was located in the previous frame.

Type:
Source:
src/gameobjects/components/Core.js line 250

<readonly> previousRotation : number

The rotation the Game Object was in set to in the previous frame. Value is in radians.

Type:
  • number
Source:
src/gameobjects/components/Core.js line 257

<readonly> renderOrderID : number

The render order ID is used internally by the renderer and Input Manager and should not be modified. This property is mostly used internally by the renderers, but is exposed for the use of plugins.

Type:
  • number
Source:
src/gameobjects/components/Core.js line 265

world : Phaser.Point

The world coordinates of this Game Object in pixels. Depending on where in the display list this Game Object is placed this value can differ from position, which contains the x/y coordinates relative to the Game Objects parent.

Type:
Source:
src/gameobjects/components/Core.js line 236

<readonly> z : number

The z depth of this Game Object within its parent Group. No two objects in a Group can have the same z value. This value is adjusted automatically whenever the Group hierarchy changes. If you wish to re-order the layering of a Game Object then see methods like Group.moveUp or Group.bringToTop.

Type:
  • number
Source:
src/gameobjects/components/Core.js line 202

Methods

<protected, static> init()

Initializes the mixin components.

The this context should be an instance of the component mixin target.

Source:
src/gameobjects/components/Core.js line 62

<protected, static> install()

Installs / registers mixin components.

The this context should be that of the applicable object instance or prototype.

Source:
src/gameobjects/components/Core.js line 29

<protected> postUpdate()

Internal method called by the World postUpdate cycle.

Source:
src/gameobjects/components/Core.js line 392

<protected> preUpdateChildren()

Internal method called by preUpdate.

Source:
src/gameobjects/components/Core.js line 354

update()

Override this method in your own custom objects to handle any update requirements. It is called immediately after preUpdate and before postUpdate. Remember if this Game Object has any children you should call update on those too.

Source:
src/gameobjects/components/Core.js line 381

phaser-ce@2.10.6 is on GitHub and NPM

Documentation generated by JSDoc 3.5.4 on 2018-06-01 using Tomorrow.