Had to take a quick break from the docs to regain sanity, so wrote this insanely fun 
demo script that I thought you might enjoy.

-Carl
REBOL [
        Title:  "Cool Effect Gels"
        Author: "Carl Sassenrath"
        Date:   20-July-2000
        File:   %gels.r
        Purpose: {
                A great example of the REBOL/View engine.
        }
        Category: [view vid 3]
        Needs: [view]
]

the-image: %bay.jpg  ; try your own here

; Layout to edit:
faces: layout [
        size 400x400
        backdrop the-image
        subtitle "Grab the gel and drag it around. It's real!"
        text "Click on button below to change the effect."
        at 20x360
        rota: rotary data [] [
                v-face/effect: pick effects index? rota/data
                show v-face
        ]
        at 200x250 pos: title 100x30
]

effects: [
        [contrast 50]
        [invert]
        [emboss]
        [colorize 0.0.200]
        [gradcol 1x1 0.0.255 255.0.0]
        [tint 100]
        [grayscale]
        [multiply 80.0.200]
        [flip 0x1]
        [flip 1x0]
        [rotate 90]
        [reflect 1x1]
        [blur]
        [sharpen]
]

foreach e effects [append rota/data first e]
vid-face: get-style 'face

append faces/pane v-face: make vid-face [
        size: 100x100
        pos/text: offset: 64x0
        edge: make edge [color: 250.120.40 size: 2x2]
        color: font: para: text: data: image: none
        effect: first effects
        feel: make feel [
                engage: func [f a e] [  ;intercepts target face events
                        if find [over away] a [
                                pos/text: f/offset: confine f/offset + e/offset - 
f/data f/size
                                        0x0 f/parent-face/size
                                f/effect: pick effects index? rota/data
                                show [f pos]
                        ]
                        if a = 'down [f/data: e/offset]
                ]
        ]
]

view faces

bay.jpg


Reply via email to