Economy-x-Talk - Sample Scripts
CenterImage
Script by Colin Holgate to move the card picture to the center of the card.
Quote from an e-mail from Colin:
I am absolutely sure that using a binary split half technique it
would be possible to speed this up a lot, but just so you know that
it's possible, this will center whatever card art there is. Just put
this somewhere (card, bg, stack, etc) and type centerimage in the
message box, after doing some doodling.
The demo has been slightly adjusted by
on centerimage
lock screen
put the width of card window into cardwidth
put the height of card window into cardheight
put findleft() into theleft
put findright() into theright
put findtop() into thetop
put findbottom() into thebottom
if theleft*theright*thetop*thebottom = 0 then
answer "no card picture"
else
choose select tool
drag from 0,0 to cardwidth,cardheight with commandkey
drag from theleft+round((theright-theleft)/2),thetop+round((thebottom-thetop)/2) to cardwidth/2,cardheight/2
end if
choose browse tool
end centerimage
function findleft
put the width of card window into cardwidth
put the height of card window into cardheight
choose select tool
put 0 into theleft
repeat with a = 1 to cardwidth
drag from 0,0 to a,cardheight with commandkey
if there is a menuitem "copy picture" of menu "edit" then
put a into theleft
exit repeat
end if
end repeat
return theleft
end findleft
function findright
put the width of card window into cardwidth
put the height of card window into cardheight
choose select tool
put 0 into theright
repeat with a = cardwidth down to 1
drag from a,0 to cardwidth,cardheight with commandkey
if there is a menuitem "copy picture" of menu "edit" then
put a into theright
exit repeat
end if
end repeat
return theright
end findright
function findtop
put the width of card window into cardwidth
put the height of card window into cardheight
choose select tool
put 0 into thetop
repeat with a = 1 to cardheight
drag from 0,0 to cardwidth,a with commandkey
if there is a menuitem "copy picture" of menu "edit" then
put a into thetop
exit repeat
end if
end repeat
return thetop
end findtop
function findbottom
put the width of card window into cardwidth
put the height of card window into cardheight
choose select tool
put 0 into theright
repeat with a = cardheight down to 1
drag from 0,a to cardwidth,cardheight with commandkey
if there is a menuitem "copy picture" of menu "edit" then
put a into thebottom
exit repeat
end if
end repeat
return thebottom
end findbottom
on parkPict
lock screen
choose select tool
doMenu "Select" with commandKey
doMenu "opaque"
drag from 300,200 to 200,365
choose browse tool
end parkPict
on closeCard
parkPict
end closeCard
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.