[SOLVED] Totally transparent panel with visible buttons

Posted By: Aku_Aku

[SOLVED] Totally transparent panel with visible buttons - 10/02/16 10:00

I tried to create a totally transparent panel with visible buttons. With no real success. This way:
Code:
mPanel = pan_create(NULL, 1);
mPanel.bmap = bmap_createblack(128, 128, 16);
tbmp1 = bmap_create("button.png");
pan_setbutton(mPanel,0,1,2,2,tbmp1,tbmp1,tbmp1,tbmp1,button_says,NULL,NULL);
set(mPanel,TRANSLUCENT);
set(mPanel,SHOW);


I have a panel with a button. Unfortunately it is not totally transparent panel.
If it covers an other panel, that becomes little bit greyer, a bit shadowed.
I played with mPanel.alpha but as i set to lower and more lower value, the button becomes also more and more transparent.
Please give some advise or show me the way, how could i achieve what i wrote in the subject of the post ?
Posted By: Reconnoiter

Re: Totally transparent panel with visible buttons - 10/02/16 10:10

For this I personally just use no bmap for the panel and buttons with transparent images/bmaps. I also dont set the TRANSLUCENT flag (unless you want to play with the alpha of the buttons during gameplay).
Posted By: Aku_Aku

[SOLVED] Totally transparent panel with visible buttons - 10/02/16 10:35

I think i am lucky this day, because i have found something that is working that way that i want.
I have changed the code this way (see the comments):
Code:
mPanel = pan_create(NULL, 1);
mPanel.bmap = bmap_createblack(128, 128, 32); // changed from 16 to 32
bmap_fill(mPanel.bmap,vector(0,0,0),0); // added now
tbmp1 = bmap_create("button.png");
pan_setbutton(mPanel,0,1,2,2,tbmp1,tbmp1,tbmp1,tbmp1,button_says,NULL,NULL);
set(mPanel,TRANSLUCENT);
set(mPanel,OVERLAY); // added now
set(mPanel,SHOW);


Miracle! It works! smile
Posted By: Reconnoiter

Re: [SOLVED] Totally transparent panel with visible buttons - 10/02/16 11:02

Good ol' overlay laugh , just keep buttons pixels/color above 0,0,0 I think
© 2024 lite-C Forums