MCPcopy Create free account
hub / github.com/melonjs/melonJS / getPostEffect

Method getPostEffect

packages/melonjs/src/renderable/renderable.js:500–507  ·  view source on GitHub ↗

* Get post-processing shader effects. * When called with a class, returns the first effect matching the given class. * When called without arguments, returns the full effects array. * @param {Function} [effectClass] - the effect class to search for * @returns {GLShader|ShaderEffect|Array|und

(effectClass)

Source from the content-addressed store, hash-verified

498 * const allEffects = sprite.getPostEffect();
499 */
500 getPostEffect(effectClass) {
501 if (typeof effectClass === "undefined") {
502 return this.postEffects;
503 }
504 return this.postEffects.find((fx) => {
505 return fx instanceof effectClass;
506 });
507 }
508
509 /**
510 * Remove all post-processing shader effects.

Callers 1

renderable.spec.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected