phaser/v3/src/gameobjects/image/ImageWebGLRenderer.js

33 lines
949 B
JavaScript
Raw Normal View History

2016-12-07 02:28:22 +00:00
var ImageWebGLRenderer = 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;
}
2017-01-19 23:20:36 +00:00
// var verts = src.transform.getVertexData(interpolationPercentage, renderer);
// var index = src.frame.source.glTextureIndex;
// var tint = src.color._glTint;
// var bg = src.color._glBg;
// renderer.batch.add(frame.source, src.blendMode, verts, frame.uvs, index, alpha, tint, bg);
2016-12-07 02:28:22 +00:00
2017-01-19 23:20:36 +00:00
var transform = src.transform;
renderer.spriteBatch.add(
frame,
2017-01-23 19:35:14 +00:00
transform._anchorX, transform._anchorY,
2017-01-19 23:20:36 +00:00
transform.world.tx, transform.world.ty,
transform._worldScaleX, transform._worldScaleY,
2017-01-23 14:58:58 +00:00
transform._worldRotation,
src.color._glTint
2017-01-19 23:20:36 +00:00
);
2016-12-07 02:28:22 +00:00
};
module.exports = ImageWebGLRenderer;