pixijs / pixi-particles-editor

PIXI-based particle editor
http://pixijs.github.io/pixi-particles-editor/
MIT License
65 stars 20 forks source link

Background Image instead of Background Color #19

Open knotdvn opened 2 years ago

knotdvn commented 2 years ago

Could anyone point me in the right direction to set a Background Image instead of a Background Color?

Specifically for the Stage.

andrewstart commented 2 years ago

That is not a feature in the current editor.

knotdvn commented 2 years ago

I'd be satisfied with a hacky few lines of JS to enter in the console. I found: this.app.editor.webgl.stage.children[0] and this.app.editor.canvas2d.stage.children[0] depending on the renderer toggle

seems to be the ref to the background sprite but modifying the _texture._baseTexture.imageUrl doesn't seem to do the trick.

Heck, if there were a few lines to set the background alpha to 0 for the stage and the canvas I could hacky add an image behind it in the dom

end goal is our creative team to test+modify+tweak particle animations on top of a screenshot of where it will be used in final media without having to run build pipelines.

I can't decide whether to solve from this.app or from this.PIXI , plz forgive, thanks a-plenty

andrewstart commented 2 years ago

Going into the private variables of Sprite/Texture definitely won't get you anywhere in this case. I think you'd want something like ...children[0].texture = this.PIXI.Texture.from(<background url of hosted file somewhere>)