rebol [ title: "Flash8 - blendMode" type: 'swf8 file: %swf8-blendmode.swf background: 255.255.255 rate: 12 size: 320x320 author: "Oldes" email: oliva.david@seznam.cz date: 5-10-2005 purpose: {To test and demonstrate the blending modes} comment: {} compressed: true ] background 255.255.255 include %includes/txt_info.rswf shp_bg: shape [ with transparency gradient [ radial colors [ 0.0.0.255 0.0.255.255 0.255.0.255 255.0.0.0 ] ] circle 160 ] shp_box: shape [ with transparency gradient [ radial colors [ 0.0.0.255 0.0.255.255 0.255.0.255 255.0.0.0 ] ] box -70x-70 70x70 circle 60 ] spr_bg: sprite shp_bg spr_box: sprite shp_box bg: place spr_bg [at 160x160 blend "diference"] box1: place spr_box at 120x120 box2: place spr_box at 200x120 box3: place spr_box at 120x200 box4: place spr_box at 200x200 doAction [ modes: [ "normal" "layer" "darken" "multiply" "lighten" "screen" "overlay" "hardLight" "add" "subtract" "diference" "invert" "alpha" "erase" ] i: 0 ;I don't change the background, ;so I can cache it as a Bitmap: bg.cacheAsBitmap: true changeBlendModes: func[][ mode: modes/:i info: reform ["Mode: " (i + 1) mode] box1.blendMode: mode box2.blendMode: mode box3.blendMode: mode box4.blendMode: mode i++ if i = modes.length [i: 0] ] changeBlendModes() int: setInterval(changeBlendModes 800) ] showFrame end