Page 1 of 1

Strange behaviour using "border" tag

Posted: Tue Mar 06, 2012 4:51 pm
by Allanon
Hi Andreas,
when I use the border tag with layers and I modify the alpha channel of the layer I have a "tint" effect applied to the entire layer, please have a look at the following snippet:

Code: Select all

EnableLayers()
CreateLayer(10,10,400,400,
            { Alphachannel = True,
              Clear        = True,
              Border       = True,
              BorderColor  = $66FF0000,
              BorderSize   = 8 })

SelectAlphaChannel(1, #LAYER)
   SetAlphaIntensity(20)
   SetFillStyle(#FILLCOLOR)
   Box(0,0,400,400, $00FF00)
EndSelect()

SelectLayer(1)
   Box(0,0,400,400, $00FF00)
EndSelect()

WaitLeftMouse()
- The border should be red, and infact it is
- The layer body should be green, dark green to be precise because of the alpha channel and the black background, but it's redish, and it's connected with the border color (changing the border color changes the layer body color).

I could be a bug?

Re: Strange behaviour using "border" tag

Posted: Fri Mar 09, 2012 2:27 pm
by airsoftsoftwair
No, that's not a bug. Just try to increase the alpha intensity using SetAlphaIntensity(200) or so. Then you will see the green color clearly. You are only using a very weak alpha transparency. 20 will make it hardly visible.

The reddish color comes from the border. Remember that if the main layer is transparent, the border will shine through. The term "border" is a little bit confusing here because in reality the border is actually a second layer beneath the main layer. You will see this as soon as the main layer becomes partly transparent.

Re: Strange behaviour using "border" tag

Posted: Fri Mar 09, 2012 9:03 pm
by Allanon
Oki, thank you for the explanation :)