tilemap
tilemap copied to clipboard
Pixi Filters do not animate over tilemap
Hello,
Has anyone gotten pixi filters, such as the GodRayFilter https://pixijs.io/pixi-filters/docs/PIXI.filters.GodrayFilter.html to animate over a tilemap?
My filter appears but it fails to animate over the tilemap.
the thing is, tilemap doesn't have bounds, and filter requires bounds. If your tilemap is fullscreen, you can just specify tilemap.filterArea = app.screen or tilemap.filterArea=renderer.screen, and it'll work just fine. Otherwise, create a rectangle with screen coords and set filterArea to it.
I'm sorry I didnt see your issue, next time bump it to get my attention if i dont answer in a week
Does not seem like either tilemap.filterArea = app.screen, nor tilemap.filterArea = new Rectangle(0, 0, 99999, 99999) work, not with AlphaFilter or BlurFilter at least.
pixiTilemap.filterArea = new Rectangle(0, 0, 99999, 99999);
pixiTilemap.filters = [
new AlphaFilter(0.5),
];
These lines seem to affect nothing.
Oh, though filters do work if you wrap tilemap in a parent container and apply filters on that parent container rather than on tilemap itself.
import { Container, AlphaFilter } from "pixi.js";
const cont = new Container();
app.stage.addChild(cont);
cont.filters = [
new AlphaFilter(layer.opacity)
];
cont.addChild(pixiTilemap);