Bug #495
Set Transparent only applies to colour zero regardless of index used.
0%
Description
I was under the impression that set transparent could be used to set any palette colour to transparent, however, regardless of the index stated, only colour 0 becomes transparent (and any other palette colour with value $000000)
What's interesting though, is that if you try to set colour 0 to another colour, for example Colour 0,$ff0000, the corresponding palette colour (which is colour number 4 in the standard 32 colour palette, becomes transparent in addition to original colour 0. If this is done, Stop Transparent no longer works.
Example:-
// Run once then de-comment line 6 and run again
#manifest:"aoz"
screen open 0,1280,720,32,0
screen open 1,1280,720,32,0
//screen to front 1
for f=0 to 9
Ink f
Bar f*128,0,128,720
Next f
Screen 0
ink 20
Set font 0,128
Text 0,300,"HELLO WORLD"
Screen 1
set transparent 0
Print "Press a key to STOP TRANSPARENT"
wait key
Stop Transparent
Print "Press a key to SET TRANSPARENT 5"
wait key
Set Transparent 5
Print "Press a key to finish"
wait Key
Updated by David Baldwin over 3 years ago
Ignore code above, there's a line missing, this is correct:-
// Run once then de-comment line 6 and run again
#manifest:"aoz"
screen open 0,1280,720,32,0
screen open 1,1280,720,32,0
//colour 0,$ff0000
screen to front 1
for f=0 to 9
Ink f
Bar f*128,0,128,720
Next f
Screen 0
ink 20
Set font 0,128
Text 0,300,"HELLO WORLD"
Screen 1
set transparent 0
Print "Press a key to STOP TRANSPARENT"
wait key
Stop Transparent
Print "Press a key to SET TRANSPARENT 5"
wait key
Set Transparent 5
Print "Press a key to finish"
wait Key