2017-01-24 18:08:56 +00:00
|
|
|
|
2017-02-23 03:54:54 +00:00
|
|
|
var Class = require('../../utils/Class');
|
2017-01-24 18:08:56 +00:00
|
|
|
var GameObject = require('../GameObject');
|
2017-02-23 03:54:54 +00:00
|
|
|
var Components = require('../../components');
|
|
|
|
var SpriteRender = require('./SpriteRender');
|
|
|
|
|
|
|
|
var Sprite = new Class({
|
|
|
|
|
|
|
|
Mixins: [
|
|
|
|
Components.Transform,
|
|
|
|
Components.Texture,
|
|
|
|
Components.Size,
|
|
|
|
Components.Alpha,
|
|
|
|
Components.BlendMode,
|
|
|
|
Components.ScaleMode,
|
|
|
|
Components.Visible,
|
|
|
|
SpriteRender
|
|
|
|
],
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
function Sprite (state, x, y, texture, frame)
|
|
|
|
{
|
|
|
|
GameObject.call(this, state);
|
|
|
|
|
|
|
|
this.setPosition(x, y);
|
|
|
|
this.setTexture(texture, frame);
|
2017-01-24 18:08:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = Sprite;
|