phaser/wip/gameobjects/image/ImageWebGLRenderer.js

28 lines
739 B
JavaScript
Raw Normal View History

Phaser.Renderer.WebGL.GameObjects.Image = {
TYPES: [
Phaser.GameObject.Image.prototype
],
render: function (renderer, src, interpolationPercentage)
{
var frame = src.frame;
var alpha = src.color.worldAlpha * 255 << 24;
// Skip rendering?
if (src.skipRender || !src.visible || alpha === 0 || !frame.cutWidth || !frame.cutHeight)
{
return;
}
2016-11-09 12:25:26 +00:00
var verts = src.transform.getVertexData(interpolationPercentage);
var index = src.frame.source.glTextureIndex;
2016-10-23 10:25:44 +00:00
var tint = src.color._glTint;
var bg = src.color._glBg;
2016-10-31 00:03:57 +00:00
renderer.batch.add(frame.source, src.blendMode, verts, frame.uvs, index, alpha, tint, bg);
}
};