2017-09-12 23:58:25 +00:00
|
|
|
var GameObject = require('../../GameObject');
|
|
|
|
|
2017-03-15 01:07:58 +00:00
|
|
|
var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera)
|
|
|
|
{
|
2017-09-17 15:53:31 +00:00
|
|
|
if (GameObject.RENDER_MASK !== src.renderFlags || (src.cameraFilter > 0 && (src.cameraFilter & camera._id)) || src.text === '')
|
2017-03-15 01:07:58 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-03-21 21:06:36 +00:00
|
|
|
if (src.dirty)
|
|
|
|
{
|
2017-07-27 19:26:12 +00:00
|
|
|
src.canvasTexture = renderer.uploadCanvasToGPU(src.canvas, src.canvasTexture, true);
|
2017-03-21 21:06:36 +00:00
|
|
|
src.dirty = false;
|
|
|
|
}
|
2017-09-17 15:53:31 +00:00
|
|
|
|
2017-07-27 19:26:12 +00:00
|
|
|
renderer.spriteBatch.addSpriteTexture(src, camera, src.canvasTexture, src.canvas.width, src.canvas.height);
|
2017-03-15 01:07:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = TextWebGLRenderer;
|