Semi-transparent faces in /View
[1/6] from: tmoeller:fastmail:fm at: 1-Aug-2005 11:25
Hi, is it possible to create a semi-tranparent face with /View, where i can see the face or window behind the face?? Perhaps there is someone who did that before! Cheers Thorsten ------ Thorsten Moeller Schwalbenweg 5a 22453 Hamburg Fon: 040 / 589 17 980 Mobil: 0171 / 490 33 59 Mail: [tmoeller--fastmail--fm] -- http://www.fastmail.fm - Access your email from home and the web
[2/6] from: antonr:lexicon at: 1-Aug-2005 21:58
Hello Thorsten, Yes, semi-transparent faces are possible. Here are two different ways: view layout [ b: box navy "hello" at b/offset + 20x20 box effect [merge luma 20] ] view make face [ offset: 100x100 size: 200x200 pane: make face [size: 100x100 color: navy effect: [merge alphamul 100]] ] Anton.
[3/6] from: tmoeller::fastmail::fm at: 1-Aug-2005 14:25
Hi Anton, thats great news. But, to understand what happens and to use for my purpose, i need to understand what is going on. So, i hope i do not request to much, asking for some additional explanation on this. Thanks so far. Thorsten On Mon, 1 Aug 2005 21:58:52 +1000, "Anton Rolls" <[antonr--lexicon--net]> said:
> Hello Thorsten, > Yes, semi-transparent faces are possible.
<<quoted lines omitted: 23>>> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - Send your email first class
[4/6] from: antonr::lexicon::net at: 2-Aug-2005 19:45
Not at all. I just banged off a few quick examples late at night, that's all. Here's another three examples: site: select load-thru http://www.reboltech.com/index.r [folder "Anton"] clear find site %index.r do-thru/update site/demo/alpha.r do-thru/update site/demo/demo-alpha.r do-thru/update site/demo/demo-alpha-blend.r But let's explain the two examples I posted previously a bit more. The following example sets the EFFECT facet of the second box to [merge luma 20]. MERGE means when the face is rendered the background behind the face is merged with the face when it is rendered by the view system. LUMA 20 is a command to brighten or darken (try -20) the colours in the face. So the overall effect is to brighten a copy of the background. This example also uses the LAYOUT function to create all the faces (ie. it uses VID on top of the View system). view layout [ ; this is the specification block to create ; the what will become the window face. ; The VIEW function opens it as a window. ; The following VID styles are interpreted ; by LAYOUT (so this block is written in the ; LAYOUT dialect, which allows normal rebol ; code to be mixed in) and it creates two ; "box"-style faces and puts them in the pane ; for you. b: box navy "hello" at b/offset + 20x20 box effect [merge luma 20] ] This example makes the faces directly (not making use of the VID, the Visual Interface Dialect). ALPHAMUL multiplies the alpha value of all the pixels in the rendering face. view make face [ ; this becomes the window face (thanks to the VIEW function) offset: 100x100 size: 200x200 pane: make face [ ; this is the only subface (pane face) of the window ; Basically, a smaller, navy-coloured box, merged with ; the background. size: 100x100 color: navy effect: [merge alphamul 100] ] ] The MAKE FACE [...] you see above is making new face objects from a prototype face SYSTEM/STANDARD/FACE. The spec block [...] just specifies the changes from the prototype, so everything else is the same as in the original prototype face. The global word FACE is set to SYSTEM/STANDARD/FACE, so I'm just using FACE for typing convenience. I'm only hoping I've covered some of the territory unknown to you, so feel free to ask more questions. Regards, Anton.
[5/6] from: petr::krenzelok::trz::cz at: 2-Aug-2005 11:56
Hi, I am not sure it was noted here, but when you work with transparent faces, you should be aware of unnecessary redraws. Simply if you 'show such face, it can cause redraw of background face hierarchies, which can slow down your display. There is field called 'saved-area, I don't remember correctly how it is used, perhaps you could set it to 'true, so that "background" is cached then and bacground face structures don't need to be re-rendered. But you can't use such principle if there are some movements (animations) in the bacground of course. Please correct me someone if I am wrong. -pekr-
[6/6] from: antonr::lexicon::net at: 4-Aug-2005 1:28
SAVED-AREA: To get the official explanation, search for "saved-area" in this document: http://www.rebol.com/docs/view-system.html Anton.
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted