Page 1 of 1

text and transparency

Posted: Fri Aug 12, 2022 9:22 am
by Top l'âne
While making my previous demo I faced an unexpected issue of priority display with text.

Here, text and hud are both set on BG_A, but the box of the text smashes the tiles instead of transparency:

Image


In this other case, text and tiles are set on BG_B, and the box of text do not show transparency:


Image


Many attempts, modifying priority effects of tiles and text cause the primary objective was to scroll the hud and text with it.
At last I write text on BG_A, but only when no tile is shared with on this plan.


What did I miss?

Re: text and transparency

Posted: Tue Aug 23, 2022 2:44 am
by AmateurSegaDev
Can you paste your code?

Re: text and transparency

Posted: Tue Aug 23, 2022 2:57 pm
by Chilly Willy
Not saying this is the problem, but remember the priority chain: S > A > B > G. For B to show up over A, it must have its priority bit set. If A has its priority bit set, B will never show over it. Another thing to remember is that transparent pixels MUST be 0. I've seen tilesets designed to use another value as transparent. Those will not be transparent on the MD. Finally, remember that the VDP sets which palette bank value 0 is the background. The MD doesn't have 64 colors (ignoring shadow/hilite), it has 60 + 1 background that can be chosen on the fly from four different values.

Re: text and transparency

Posted: Tue Aug 23, 2022 3:34 pm
by Top l'âne
@amateurSC:
I only use the VDP_drawTextEx();
I use the last color from 4 existing palettes in the demo. (bricks, sprites...).


I have not worked on this problem yet but I have noticed lately that my graphic tool (mtpaint), saves images with a -1 as defaut transparency state.
I considered this could be a valuable clue.

And you, Chilly, give me the feeling I might be right.
I will start a brand new demo very soon and I will take care with the images' savings.

Colors and palettes use were pretty complicated processes to me but this stuff becomes brighter those days.
I'm fine with the idea of 60+1 colors.
When I create/set a 16 colors palette, I always consider the 0 as the transparency.

I feel quite comfortable as well with the priority chain. I'll be glad to show this very soon... Next release on september!

Thanks guys. :D