add texture to IUIRenderData

This commit is contained in:
Jone
2019-01-22 18:26:40 +08:00
committed by Yun Hsiao Wu
parent a62bfdb768
commit 34429bdda0
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -140,6 +140,7 @@ export const simple: IAssembler = {
commitBuffer.meshBuffer = buffer;
commitBuffer.material = sprite.material!;
commitBuffer.texture = sprite.spriteFrame!;
commitBuffer.camera = renderer.getScreen(sprite.viewID)!.camera!;
renderer.addToQueue(commitBuffer);
},
+6 -1
View File
@@ -25,7 +25,11 @@ import { BaseNode } from '../../scene-graph/base-node';
import { Pass } from '../core/pass';
import { Camera } from '../scene/camera';
import { RenderScene } from '../scene/render-scene';
<<<<<<< HEAD
import { IUIMaterialInfo, UIMaterial } from './ui-material';
=======
import { SpriteFrame } from '../../assets/CCSpriteFrame';
>>>>>>> 86462dac... add texture to IUIRenderData
export interface IUIBufferBatch {
vb: GFXBuffer;
@@ -42,6 +46,7 @@ export interface IUIRenderItem {
export interface IUIRenderData {
meshBuffer: MeshBuffer;
material: Material;
texture: SpriteFrame,
camera: Camera;
}
@@ -277,12 +282,12 @@ export class UI {
private _reset () {
this._bufferPool.reset();
this._commitUIRenderDataPool.reset();
this._commitUIRenderDatas.length = 0;
}
private _commitComp (comp: UIRenderComponent) {
comp.updateAssembler(this);
// const canvasComp: CanvasComponent | null = this.getScreen(comp.viewID);
// const renderDataFormat: IUIRenderData = this._commitUIRenderDataPool.add();
// renderDataFormat.meshBuffer = buffer;
// renderDataFormat.material = comp.material as Material;