phaser/v3/src/gameobjects/image/Image.js

42 lines
898 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.Flip,
Components.GetBounds,
Components.Origin,
2017-04-07 01:49:15 +00:00
Components.RenderTarget,
Components.ScaleMode,
Components.Size,
Components.Texture,
Components.Transform,
Components.Visible,
2017-06-22 02:19:03 +00:00
Components.ScrollFactor,
ImageRender
],
initialize:
function Image (state, x, y, texture, frame)
{
GameObject.call(this, state, 'Image');
this.setTexture(texture, frame);
this.setPosition(x, y);
this.setSizeToFrame();
this.setOrigin();
}
});
2016-12-07 02:28:22 +00:00
module.exports = Image;