phaser/v3/src/gameobjects/blitter/BlitterWebGLRenderer.js

30 lines
626 B
JavaScript
Raw Normal View History

var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage)
{
2017-01-24 13:15:25 +00:00
var worldAlpha = src.color.worldAlpha;
2017-02-01 01:40:11 +00:00
var len = src.children.list.length - 1;
// Skip rendering?
if (src.skipRender || !src.visible || worldAlpha === 0 || len === 0)
{
return;
}
// Render bobs
2017-02-03 16:11:31 +00:00
for (var i = 0; i <= len; ++i)
{
var bob = src.children.list[i];
var frame = bob.frame;
2017-02-01 01:40:11 +00:00
// if (!bob.visible)
// {
// continue;
// }
2017-01-24 13:15:25 +00:00
renderer.blitterBatch.add(bob.x, bob.y, frame, worldAlpha);
}
};
module.exports = BlitterWebGLRenderer;