Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Semi-transparent faces in /View

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.