* Override the default preDraw to skip the base class's anchor offset * translation and `autoTransform` application — `ImageLayer.draw()` * computes its own world-space position from the viewport, the parallax * `ratio`, anchor, and zoom, so applying anchor/transform here would * double-tran
(renderer)
| 239 | * @ignore |
| 240 | */ |
| 241 | preDraw(renderer) { |
| 242 | // save the context |
| 243 | renderer.save(); |
| 244 | |
| 245 | // apply the defined alpha value |
| 246 | renderer.setGlobalAlpha(renderer.globalAlpha() * this.getOpacity()); |
| 247 | |
| 248 | // delegate post-effect setup to the renderer (custom shader / postEffects) |
| 249 | if (!this._postEffectManaged) { |
| 250 | renderer.beginPostEffect(this); |
| 251 | } |
| 252 | |
| 253 | // apply the defined tint |
| 254 | renderer.setTint(this.tint); |
| 255 | |
| 256 | // apply blending if different from "normal" |
| 257 | if (this.blendMode !== renderer.getBlendMode()) { |
| 258 | renderer.setBlendMode(this.blendMode); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * draw this ImageLayer (automatically called by melonJS) |
nothing calls this directly
no test coverage detected