phaser/src/gameobjects/image/Image.js

45 lines
995 B
JavaScript
Raw Normal View History

var Class = require('../../utils/Class');
2016-12-07 02:28:22 +00:00
var GameObject = require('../GameObject');
var Components = require('../components');
var ImageRender = require('./ImageRender');
var Image = new Class({
2017-04-05 01:10:48 +00:00
Extends: GameObject,
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.Depth,
Components.Flip,
Components.GetBounds,
Components.Origin,
2018-01-29 21:46:48 +00:00
Components.Pipeline,
Components.ScaleMode,
Components.ScrollFactor,
Components.Size,
Components.Texture,
Components.Tint,
Components.Transform,
Components.Visible,
ImageRender
],
initialize:
function Image (scene, x, y, texture, frame)
{
GameObject.call(this, scene, 'Image');
this.setTexture(texture, frame);
this.setPosition(x, y);
this.setSizeToFrame();
this.setOrigin();
2018-01-29 21:46:48 +00:00
this.initPipeline('TextureTintPipeline');
}
});
2016-12-07 02:28:22 +00:00
module.exports = Image;