phaser/v3/src/gameobjects/sprite/Sprite.js

37 lines
789 B
JavaScript
Raw Normal View History

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