Feb 14th
Scott Rossi
scott at tactilemedia.com
Sun Feb 14 02:54:41 EST 2010
Nice Malte.
Here's a solution that is nowhere near as elegant as Malte's code, but the
result is perhaps a bit more "tactile" :-)
on mouseUp
buildV
buildO -1
buildO 1
runAnim
end mouseUp
command buildO M
put "style,opaque,linesize,backcolor," & \
"width,height,antialiased" into V1
put "oval,true,0,red,120,120,true" into V2
put 1 into N
repeat for each item P in V1
set the P of the templateGraphic to item N of V2;add 1 to N
end repeat
put loc of this cd into tLoc
add (M*46) to item 1 of tLoc
if M = -1 then add 1 to item 1 of tLoc
add -68 to item 2 of tLoc
set loc of the templateGraphic to tLoc
create grc
set fillGradient of last grc to gfx(long id of last grc)
reset the templateGraphic
end buildO
command buildV
put "style,opaque,linesize,backcolor,width,height," & \
"antialiased,polysides,angle" into V1
put "regular,true,0,red,231,160,true,3,90" into V2
put 1 into N
repeat for each item P in V1
set the P of the templateGraphic to item N of V2;add 1 to N
end repeat
set loc of the templateGraphic to loc of this cd
create grc
set dropshadow of last grc to sfx()
reset the templateGraphic
end buildV
function gfx pObj
put "type,from,via,to,quality,repeat,wrap,mirror" into V1
put "radial"&cr&"0,0"&cr&"0,0"&cr&"0,0"&cr&"good" & \
cr&1&cr&"false"&cr&"false" into V2
put 1 into N
repeat for each item P in V1
put line N of V2 into A[P];add 1 to N
end repeat
put -37 into M
put rect of pObj into R
put loc of pObj into L
put item 1 of L,item 2 of L + M into A["from"]
put item 3 of R,item 2 of L + M into A["via"]
put item 1 of L,item 4 of R + M into A["to"]
put 0,255,190,190&cr&1,255,0,0 into A["ramp"]
return A
end gfx
function sfx
put "opacity,blendmode,size,distance,filter," & \
"knockout,spread,angle" into V1
put "255,normal,20,10,gaussian,true,0,90" into V2
put 1 into N
repeat for each item P in V1
put item N of V2 into A[P];add 1 to N
end repeat
put "0,0,0" into A["color"]
return A
end sfx
on runAnim
put number of grcs into gNum
repeat with N = 0 to 1
set width of grc (gNum - N) to width of grc (gNum - N) + 10
set height of grc (gNum - N) to height of grc (gNum - N) + 10
end repeat
set bottom of grc (gNum - 2) to bottom of grc (gNum - 2) + 8
wait 300 millisecs with messages
repeat with N = 0 to 1
set width of grc (gNum - N) to width of grc (gNum - N) - 10
set height of grc (gNum - N) to height of grc (gNum - N) - 10
end repeat
set bottom of grc (gNum - 2) to bottom of grc (gNum - 2) - 8
send "runAnim" to me in 750 millisecs
end runAnim
Happy V-Day,
Scott Rossi
Creative Director
Tactile Media, UX Design
More information about the use-livecode
mailing list