Overlay
package require media
package require mcllib
_mcl
load media and mcllib package. open mcl.
proc roll {
{direction right}
{org 100}
{start -300}
{end 680}
{cycle 2}
{step 4}
{period 100}} {
roll text in the $direction, $start, $end, $cycle, $step, $period.
set i $org
if {[string compare $direction right] == 0 \\
|| [string compare $direction down] == 0} {
move text in direction right or down.
while {$cycle > 0} {
switch $direction {
right {!text {orgx $i}}
down {!text {orgy $i}}
}
graph show
after $period
set i [expr $i+$step]
if {$i >= $end} {
set i $start
incr cycle -1
}
}
while cycle is greater than 0 write text and show text.
} else {
while {$cycle > 0} {
switch $direction {
left {!text {orgx $i}}
up {!text {orgy $i}}
}
graph show
after $period
set i [expr $i-$step]
if {$i <= $start} {
set i $end
incr cycle -1
}
}
}
}
similar to above but in the direction of left and up.
set fullname [getPath media image image000.jpg]
_theme {
title "Ladybug Studio XP"
orgx 250
orgy 90
width [expr 352]
height [expr 240]
region roundrect
mode windowless
close true}
open theme in windowless. After running the program close the theme automatically.
_text {
string "Ladybug Studio XP"
orgx 100
orgy 20
bgcolor 0xffffff
fgcolor 0x33ccff
fill 0xffffffff
font Roman
size 36
escape 0
orient 0
weight bold
italic true
underline false
strikeout false
charset ansi
pitch variable
family roman}
open text with string at orgx, orgy position. bgcolor is the background color. fgcolor is the frontground color. fill is the text surface color.
_image {name "$fullname"}
_transform {name Wipe progress 0.60}
open image and transform
set wtheme [?image width]
set htheme [?image height]
set wtext [?text width]
set htext [?text height]
set centerx [expr ($wtheme-$wtext)/2]
set centery [expr ($htheme-$htext)/2]
get image size and text size then find the center position of the text on the image.
_graph {theme {transform text image}}
!text {orgx [expr $wtheme-$wtext]
orgy $centery}
roll down $centery -$htext $htheme 2 4 6
write text in new center position and rolldown the text
!text {orgx [expr $wtheme-$wtext]
orgy $centery}
roll up $centery -$htext $htheme 2 4 10
graph_
write text in new center position and rollup the text.
transform_
image_
text_
theme_
mcl_
close transform, image, text, theme, and mcl
|