2016-10-04 14:39:54 +00:00
|
|
|
Phaser.Renderer.WebGL.GameObjects.Sprite = {
|
|
|
|
|
2016-10-05 00:25:06 +00:00
|
|
|
TYPES: [
|
2016-11-01 00:31:45 +00:00
|
|
|
Phaser.GameObject.Sprite.prototype
|
2016-10-05 00:25:06 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
render: function (renderer, src)
|
2016-10-04 14:39:54 +00:00
|
|
|
{
|
2016-11-01 00:31:45 +00:00
|
|
|
var frame = src.frame;
|
|
|
|
var alpha = src.color.worldAlpha * 255 << 24;
|
|
|
|
|
|
|
|
// Skip rendering?
|
|
|
|
if (src.skipRender || !src.visible || alpha === 0 || !frame.cutWidth || !frame.cutHeight)
|
2016-10-04 14:39:54 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
var verts = src.transform.glVertextData;
|
|
|
|
var index = src.frame.source.glTextureIndex;
|
|
|
|
var tint = src.color._glTint;
|
|
|
|
var bg = src.color._glBg;
|
2016-10-04 14:39:54 +00:00
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
renderer.batch.add(frame.source, src.blendMode, verts, frame.uvs, index, alpha, tint, bg);
|
2016-10-04 14:39:54 +00:00
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
// Render children
|
|
|
|
for (var i = 0; i < src.children.length; i++)
|
2016-10-04 14:39:54 +00:00
|
|
|
{
|
2016-11-01 00:31:45 +00:00
|
|
|
var child = src.children[i];
|
2016-10-04 14:39:54 +00:00
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
child.render(renderer, child);
|
2016-10-04 14:39:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|