2016-11-28 16:55:13 +00:00
|
|
|
|
2017-02-23 03:10:48 +00:00
|
|
|
var Class = require('../../utils/Class');
|
2016-12-07 02:28:22 +00:00
|
|
|
var GameObject = require('../GameObject');
|
2017-02-23 03:10:48 +00:00
|
|
|
var Components = require('../../components');
|
|
|
|
var ImageRender = require('./ImageRender');
|
|
|
|
|
|
|
|
var Image = new Class({
|
|
|
|
|
2017-04-05 01:10:48 +00:00
|
|
|
Extends: GameObject,
|
|
|
|
|
2017-02-23 03:10:48 +00:00
|
|
|
Mixins: [
|
|
|
|
Components.Alpha,
|
|
|
|
Components.BlendMode,
|
2017-03-20 23:37:17 +00:00
|
|
|
Components.Flip,
|
2017-02-24 05:02:39 +00:00
|
|
|
Components.GetBounds,
|
2017-03-02 02:06:13 +00:00
|
|
|
Components.Origin,
|
2017-04-07 01:49:15 +00:00
|
|
|
Components.RenderTarget,
|
2017-02-23 03:10:48 +00:00
|
|
|
Components.ScaleMode,
|
2017-02-24 05:02:39 +00:00
|
|
|
Components.Size,
|
|
|
|
Components.Texture,
|
|
|
|
Components.Transform,
|
2017-02-23 03:10:48 +00:00
|
|
|
Components.Visible,
|
2017-06-22 02:19:03 +00:00
|
|
|
Components.ScrollFactor,
|
2017-02-23 03:10:48 +00:00
|
|
|
ImageRender
|
|
|
|
],
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
function Image (state, x, y, texture, frame)
|
|
|
|
{
|
2017-04-12 23:05:12 +00:00
|
|
|
GameObject.call(this, state, 'Image');
|
2017-02-23 03:10:48 +00:00
|
|
|
|
|
|
|
this.setTexture(texture, frame);
|
2017-02-24 01:45:15 +00:00
|
|
|
this.setPosition(x, y);
|
2017-03-02 04:00:39 +00:00
|
|
|
this.setSizeToFrame();
|
2017-03-15 23:44:39 +00:00
|
|
|
this.setOrigin();
|
2016-11-28 16:55:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
2016-12-07 02:28:22 +00:00
|
|
|
|
|
|
|
module.exports = Image;
|