Jump to content
  • 0

2 Layers, both in text mode


CursorKeys
 Share

Question

Hi all,

 

I have a question.

I have been making an experiment with trying to get one text layer (screen) overlap another.  I used 320x200 mode, for both.

I expected (hoped), that the color 0 in the palette of layer 2 would be seen as transparent, and being able to use one layer as an text (actually PETSCII), overlay on the other.

 

What I see instead is that when I add another text layer, it overlaps the first completely.  So nothing is transparent, so layer 1 may as well not be there, since layer 2 seems to have a higher priority.

 

And also I found another behavior that puzzles me. What I did not expect was that the map offset of the second layer, also determined it's y position on the screen.

For example, when I pointed it to some data that was at the end of layer 0 map. Then the top of layer two would be visible, overlapping the bottom of layer 1.

 

Is this expected behavior?

 

Will we get on the real hardware "real" transparency, for color 0, even for a text layer?  Or is the behavior of the emulator correct, and and we can trust that we can use the effects as seen now in our games and demos?

 

Thanks

/C

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

As long as layer 0 is enabled it will treat color 0 as transparent.  You should see it that way, so if you aren't then you're doing something wrong.  You can test it easily in BASIC with something like "POKE $9F29,$31:COLOR 1,0:CLS" and you'll see text on top of layer 0 as you type (although layer 0 will be glitchy and full of garbage initially without any setup).

  • Like 1
Link to comment
Share on other sites

  • 0

Thanks for the input, actually the simple example from Ender helped, since it made me question, why the value $31 should be poked (I was poking $20).  That led me to the conclusion, that the default layer was layer 1, and the extra was layer 0, and then it all fell into place, and transparency work fine with both text layers (which I was not sure until SlithyMatt pointed that out).   But I had to swap the map buffer pointers around, so the basic output buffer would be below.  So basically point layer 0 to $00 and point layer 1 to $0F, then it all worked as I wanted.

Next I'll be reading the scrolling and layers in Basic tutorial from DusanStrakl 🙂

Edited by CursorKeys
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use