新增prototypespriteRenderer

This commit is contained in:
yhh
2020-09-30 18:31:58 +08:00
parent dd994cb16d
commit c9c745c730
4 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
module es {
export class Graphics {
public static Instance: Graphics;
/**
* 用于绘制矩形、线条、圆等的精灵。
* 将在启动时生成但你可以用你的图集中的精灵代替以减少纹理交换。应该是一个1x1的白色像素
*/
public pixelTexture: Sprite;
constructor(){
let arrayBuffer = new ArrayBuffer(1);
arrayBuffer[0] = 0xffffff;
egret.BitmapData.create("arraybuffer", arrayBuffer, bitmapData => {
let tex = new egret.Texture();
tex.bitmapData = bitmapData;
this.pixelTexture = new Sprite(tex);
});
}
}
}