phaser/src/gameobjects/text/static/TextWebGLRenderer.js

21 lines
609 B
JavaScript
Raw Normal View History

var GameObject = require('../../GameObject');
2018-01-24 00:40:20 +00:00
var Utils = require('../../../renderer/webgl/Utils');
2018-01-24 00:40:20 +00:00
var TextWebGLRenderer = function (renderer, text, interpolationPercentage, camera)
{
2018-01-24 00:40:20 +00:00
if (GameObject.RENDER_MASK !== text.renderFlags || (text.cameraFilter > 0 && (text.cameraFilter & camera._id)) || text.text === '')
{
return;
}
2018-01-24 00:40:20 +00:00
if (text.dirty)
{
2018-01-24 00:40:20 +00:00
text.canvasTexture = renderer.canvasToTexture(text.canvas, text.canvasTexture, true, text.scaleMode);
text.dirty = false;
}
2018-01-24 00:40:20 +00:00
2018-01-30 03:38:31 +00:00
this.pipeline.batchText(this, camera);
};
module.exports = TextWebGLRenderer;