phaser/v3/src/gameobjects/zone/Zone.js

59 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-03-27 22:10:04 +00:00
var Class = require('../../utils/Class');
var GameObject = require('../GameObject');
var Components = require('../components');
var BlendModes = require('../../renderer/BlendModes');
2017-03-27 22:10:04 +00:00
var Zone = new Class({
2017-04-05 01:10:48 +00:00
Extends: GameObject,
2017-03-27 22:10:04 +00:00
Mixins: [
Components.GetBounds,
Components.Origin,
Components.ScaleMode,
Components.Size,
Components.Transform,
2017-06-22 02:19:03 +00:00
Components.ScrollFactor,
2017-03-27 22:10:04 +00:00
Components.Visible
],
initialize:
function Zone (scene, x, y, width, height)
2017-03-27 22:10:04 +00:00
{
GameObject.call(this, scene, 'Zone');
2017-03-27 22:10:04 +00:00
this.setPosition(x, y);
this.setSize(width, height);
this.setOrigin(0);
this.blendMode = BlendModes.NORMAL;
},
setDropZone: function (shape, callback)
{
if (!this.input)
{
this.setInteractive(shape, callback);
}
this.input.dropzone = true;
return this;
},
renderCanvas: function ()
{
return;
},
renderWebGL: function ()
{
return;
2017-03-27 22:10:04 +00:00
}
});
module.exports = Zone;