* 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)
| 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. |