- alias drawanim {
- if $hget(anim) != anim { hmake anim 100 }
- if $1 == -p {
- if $window(@ $+ $2) { .timer $+ $2 -p }
- else echo -a 2* /drawanim: invalid animation name
- }
- elseif $1 == -r {
- if $window(@ $+ $2) { .timer $+ $2 -r }
- else echo -a 2* /drawanim: invalid animation name
- }
- elseif $1 == -c {
- if $window(@ $+ $2) {
- var %cache @ $+ $2 $+ cache
- .timer $+ $2 off
- tokenize 32 $hget(anim,$2)
- hdel anim $3
- drawcopy %cache 0 0 $window(%cache).w $window(%cache).h $2 $5-8
- window -c @ $+ $3
- window -c %cache
- }
- else echo -a 2* /drawanim: invalid animation name
- }
- elseif $1 == -i {
- if $window(@ $+ $2) {
- if ($3 isnum) && ($3 > 0) {
- var %vitesseanim $3
- tokenize 32 $hget(anim,$2)
- hadd anim $3 $1-3 %vitesseanim $5-10
- .timer $+ $3 -om 0 %vitesseanim playanim $3
- }
- else echo -a 2* /drawanim: intervalle not valide
- }
- else echo -a 2* /drawanim: invalid animation name
- }
- elseif $window($2) {
- if $window(@ $+ $3) != @ $+ $3 {
- if $chr(32) !isin $9 {
- if $exists($9) == $true {
- if $len($hget(anim,$3)) == 0 {
- if ($4 > 0) && ($4 isnum) {
- if ($5 isnum) && ($6 isnum ) && ($7 isnum) && ($8 isnum) {
- hadd anim $3 $1-9 0
- window -pkodhnBf +dL @ $+ $3 0 0 $7 $pic($9).height
- window @ $+ $3 0 0 $7 $pic($9).height
- drawpic -s @ $+ $3 0 0 $9
- window -pkodhnBf +dL @ $+ $3 $+ cache 0 400 $7 $8
- drawcopy $2 $5-8 @ $+ $3 $+ cache 0 0
- playanim $3
- .timer $+ $3 -om 0 $4 playanim $3
- }
- else echo -a 2* /drawanim: intervalle not valide enter number value
- }
- else echo -a 2* /drawanim: intervalle not valide enter positive number
- }
- else echo -a 2* /drawanim: animation name already exists
- }
- else echo -a 2* /drawanim: file $9 not found
- }
- else echo -a 2* /drawanim: enter filename without space
- }
- else echo -a 2* /drawanim: invalid animation name, a window use this name
- }
- else echo -a 2* /drawanim: invalid window
- }
-
- alias playanim {
- tokenize 32 $hget(anim,$1)
- if $window($2) {
- var %cache @ $+ $3 $+ cache
- if ($1 == -t) {
- drawcopy -n %cache 0 0 $window(%cache).w $window(%cache).h $2 $5-8
- drawcopy -t @ $+ $3 $rgb(255,0,255) 0 $10 $7-8 $2 $5-8
- }
- else drawcopy @ $+ $3 0 $10 $7-8 $2 $5-8
- if ($calc($10 + $8) < $pic($9).height) hadd anim $3 $1-9 $calc($10 + $8)
- else hadd anim $3 $1-9 0
- }
- else {
- .timer $+ $3 off
- hdel anim $3
- window -c @ $+ $3
- window -c @ $+ $3 $+ cache
- }
- }
alias drawanim {
if $hget(anim) != anim { hmake anim 100 }
if $1 == -p {
if $window(@ $+ $2) { .timer $+ $2 -p }
else echo -a 2* /drawanim: invalid animation name
}
elseif $1 == -r {
if $window(@ $+ $2) { .timer $+ $2 -r }
else echo -a 2* /drawanim: invalid animation name
}
elseif $1 == -c {
if $window(@ $+ $2) {
var %cache @ $+ $2 $+ cache
.timer $+ $2 off
tokenize 32 $hget(anim,$2)
hdel anim $3
drawcopy %cache 0 0 $window(%cache).w $window(%cache).h $2 $5-8
window -c @ $+ $3
window -c %cache
}
else echo -a 2* /drawanim: invalid animation name
}
elseif $1 == -i {
if $window(@ $+ $2) {
if ($3 isnum) && ($3 > 0) {
var %vitesseanim $3
tokenize 32 $hget(anim,$2)
hadd anim $3 $1-3 %vitesseanim $5-10
.timer $+ $3 -om 0 %vitesseanim playanim $3
}
else echo -a 2* /drawanim: intervalle not valide
}
else echo -a 2* /drawanim: invalid animation name
}
elseif $window($2) {
if $window(@ $+ $3) != @ $+ $3 {
if $chr(32) !isin $9 {
if $exists($9) == $true {
if $len($hget(anim,$3)) == 0 {
if ($4 > 0) && ($4 isnum) {
if ($5 isnum) && ($6 isnum ) && ($7 isnum) && ($8 isnum) {
hadd anim $3 $1-9 0
window -pkodhnBf +dL @ $+ $3 0 0 $7 $pic($9).height
window @ $+ $3 0 0 $7 $pic($9).height
drawpic -s @ $+ $3 0 0 $9
window -pkodhnBf +dL @ $+ $3 $+ cache 0 400 $7 $8
drawcopy $2 $5-8 @ $+ $3 $+ cache 0 0
playanim $3
.timer $+ $3 -om 0 $4 playanim $3
}
else echo -a 2* /drawanim: intervalle not valide enter number value
}
else echo -a 2* /drawanim: intervalle not valide enter positive number
}
else echo -a 2* /drawanim: animation name already exists
}
else echo -a 2* /drawanim: file $9 not found
}
else echo -a 2* /drawanim: enter filename without space
}
else echo -a 2* /drawanim: invalid animation name, a window use this name
}
else echo -a 2* /drawanim: invalid window
}
alias playanim {
tokenize 32 $hget(anim,$1)
if $window($2) {
var %cache @ $+ $3 $+ cache
if ($1 == -t) {
drawcopy -n %cache 0 0 $window(%cache).w $window(%cache).h $2 $5-8
drawcopy -t @ $+ $3 $rgb(255,0,255) 0 $10 $7-8 $2 $5-8
}
else drawcopy @ $+ $3 0 $10 $7-8 $2 $5-8
if ($calc($10 + $8) < $pic($9).height) hadd anim $3 $1-9 $calc($10 + $8)
else hadd anim $3 $1-9 0
}
else {
.timer $+ $3 off
hdel anim $3
window -c @ $+ $3
window -c @ $+ $3 $+ cache
}
}