新增renderer渲染器 用于控制场景如何渲染

This commit is contained in:
yhh
2020-06-18 16:35:51 +08:00
parent 915056203d
commit feaac83ee7
15 changed files with 459 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
/**
* 所有可渲染组件的基类
*/
abstract class RenderableComponent extends Component {
abstract class RenderableComponent extends Component implements IRenderable {
private _isVisible: boolean;
protected _areBoundsDirty = true;
protected _bounds: Rectangle;
@@ -60,4 +60,8 @@ abstract class RenderableComponent extends Component {
this.isVisible = camera.bounds.intersects(this.bounds);
return this.isVisible;
}
public onEntityTransformChanged(comp: ComponentTransform){
this._areBoundsDirty = true;
}
}