@lightningjs/renderer
Version:
Lightning 3 Renderer
34 lines • 1.37 kB
JavaScript
import { UpdateType } from '../../core/CoreNode.js';
import { CoreAnimation, } from '../../core/animations/CoreAnimation.js';
import { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';
import { IShaderNode } from '../../main-api/IShaderNode.js';
import { assertTruthy } from '../../utils.js';
export class MainOnlyShaderNode extends IShaderNode {
loadShader() {
const node = this.node.coreNode;
node.loadShader(this.shaderType, this.props);
const l = this.propsList.length;
let i = 0;
for (; i < l; i++) {
const propName = this.propsList[i];
Object.defineProperty(this, propName, {
get: () => {
return node.shaderProps[propName];
},
set: (newValue) => {
node.shaderProps[propName] = newValue;
node.setUpdateType(UpdateType.Local);
},
enumerable: true,
configurable: true,
});
}
}
animate(props, settings) {
const node = this.node;
const animation = new CoreAnimation(this, props, settings);
const controller = new CoreAnimationController(node.stage.animationManager, animation);
return controller;
}
}
//# sourceMappingURL=MainOnlyShaderNode.js.map