Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent background #31

Closed
bebensiganteng opened this issue Mar 29, 2013 · 11 comments
Closed

Transparent background #31

bebensiganteng opened this issue Mar 29, 2013 · 11 comments

Comments

@bebensiganteng
Copy link

Hi,

is there a way to have a transparent background?

thanks!

@GoodBoyDigital
Copy link
Member

Ah yes! That would be quite handy, pixi.js is not set up for transparent backgrounds just yet, but will be super easy to change that :)
Added to my todo list..

@bebensiganteng
Copy link
Author

thanks for the reply, can you give me a hint please, maybe i could help ;)

@GoodBoyDigital
Copy link
Member

You are more than welcome too help 👍

Here's a starting point for ya :)

The background color is set here (line 78) in the canvas render:

if(this.view.style.backgroundColor!=stage.backgroundColorString)this.view.style.backgroundColor = stage.backgroundColorString;

and here (line 189) in the webGLRender:

gl.clearColor(stage.backgroundColorSplit[0], stage.backgroundColorSplit[1], stage.backgroundColorSplit[2], 1.0);

@GoodBoyDigital
Copy link
Member

better late than never! background transparency is now implemented..

var renderer = PIXI.autoDetectRenderer(400, 300, null, *true*);

@thenayr
Copy link

thenayr commented Apr 6, 2013

@GoodBoyDigital This is great! I was literally just looking to implement this. Thanks!

@bebensiganteng
Copy link
Author

wow! ... was reserving my weekends to do this but thanks!!

@bradparks
Copy link

and... for those new to pixi.js... wow! sweet!

@zur4ik
Copy link

zur4ik commented Sep 22, 2015

I put

var renderer = PIXI.autoDetectRenderer(400, 300, null, true);

but my canvas is black anyway. Any ideas?

@englercj
Copy link
Member

@zur4ik if you are using v3,that is not the proper param for autoDetectRenderer. Check out the v3 docs:

http://pixijs.github.io/docs/PIXI.html#.autoDetectRenderer

@courtneyvigo
Copy link

courtneyvigo commented Dec 1, 2016

@zur4ik - I was having the same problem. For anyone else:

var renderer = PIXI.autoDetectRenderer(256, 256, {antialias: false, transparent: true, resolution: 1});

@lock
Copy link

lock bot commented Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants