2016-10-30 22:57:50 +00:00
|
|
|
Phaser.Renderer.WebGL.GameObjects.PixelField = {
|
|
|
|
|
|
|
|
TYPES: [
|
|
|
|
Phaser.GameObject.PixelField.prototype
|
|
|
|
],
|
|
|
|
|
|
|
|
render: function (renderer, src)
|
|
|
|
{
|
2016-10-30 23:59:47 +00:00
|
|
|
var pixel;
|
2016-10-30 22:57:50 +00:00
|
|
|
var verts = src.transform.glVertextData;
|
|
|
|
|
2016-10-30 23:40:18 +00:00
|
|
|
for (var i = 0; i < src.list.length; i++)
|
|
|
|
{
|
2016-10-30 23:59:47 +00:00
|
|
|
pixel = src.list[i];
|
2016-10-30 23:40:18 +00:00
|
|
|
|
2016-10-30 23:59:47 +00:00
|
|
|
if (pixel.a > 0)
|
|
|
|
{
|
|
|
|
renderer.batch.addPixel(
|
|
|
|
verts.x0 + pixel.x,
|
|
|
|
verts.y0 + pixel.y,
|
|
|
|
verts.x1 + pixel.x,
|
|
|
|
verts.y1 + pixel.y,
|
|
|
|
verts.x2 + pixel.x,
|
|
|
|
verts.y2 + pixel.y,
|
|
|
|
verts.x3 + pixel.x,
|
|
|
|
verts.y3 + pixel.y,
|
|
|
|
pixel.color
|
|
|
|
);
|
|
|
|
}
|
2016-10-30 23:40:18 +00:00
|
|
|
}
|
2016-10-30 22:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|