Page 1 of 1

Transparent background

Posted: Wed Feb 10, 2016 11:17 am
by MarFazzo
Hi all. I have this code:

Code: Select all

define myChar = Character(what_size=34, what_outlines=[(1, "#000", 0, 0)], what_text_align=0, window_right_margin=150, window_left_margin=150)

This permits, when used in a part of the game, to have a box with 150 pixels of margin from left and from right. I know that i can specify a background with:"window_background=#HEX", and without specifying it i have a black background with a bit of transparency.

How can i obtain total transparency?

Re: Transparent background

Posted: Wed Feb 10, 2016 12:58 pm
by octacon100
"#0000" Usually produces a transparent background for me.

Re: Transparent background

Posted: Thu Feb 11, 2016 2:27 am
by PyTom
window_background=None

is a better way of accomplishing this. When you use "#0000", Ren'Py will actually create an appropriately-sized image, filled with transparent pixels, and draw it to the screen. Even if a pixel is transparent, it still needs to be sent to the graphics card and drawn. Setting the background to None triggers a special case where nothing at all is drawn - which is faster. It probably won't make a difference, but I figured I'd clarify this in case it ever does.