Resize rectangle but pin its left-top corner
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Resize rectangle but pin its left-top corner
Hi all of you Livecode geniuses....
I have 2 questions:
1. How do I resize a rectangle with a button BUT pin its top-left corner so that it remains where it is?
2. Can I resize this rectangle using an animation (visual effect)?
Thanks for any help.
Tom
I have 2 questions:
1. How do I resize a rectangle with a button BUT pin its top-left corner so that it remains where it is?
2. Can I resize this rectangle using an animation (visual effect)?
Thanks for any help.
Tom
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Re: Resize rectangle but pin its left-top corner
Hi makeshyft,
Best regards
Jean-Marc
Yes. Visual effect of your own playing with the rectCan I resize this rectangle using an animation (visual effect)?
An exemple of square resizingHow do I resize a rectangle with a button BUT pin its top-left corner so that it remains where it is
Code: Select all
on mouseUp
put the topleft of img 1 into tTL
put the width of img 1 into tWidth
put the height of img 1 into tHeight
lock screen
set the width of img 1 to round(tWidth/2)
set the height of img 1 to round(tHeight/2)
set the topleft of img 1 to tTL
unlock screen
wait 1 second
--playing with the rect
put the rect of img 1 into tRect
repeat 250
add 1 to item 3 of tRect
add 1 to item 4 of tRect
set the rect of img 1 to tRect
wait 10 milliseconds
end repeat
end mouseUp
Jean-Marc
https://alternatic.ch
Re: Resize rectangle but pin its left-top corner
another way:
Simon
Code: Select all
local tLoc
on mouseDown
put the topLeft of grc 1 into tLoc
end mouseDown
on mouseStillDown
set the height of grc 1 to the height of grc 1 + 1
set the width of grc 1 to the width of grc 1 + 1
set the topLeft of grc 1 to tLoc
end mouseStillDown
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Resize rectangle but pin its left-top corner
Thank you so much guys!!! Haven't tried it yet, but you guys seem uber-confident.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Re: Resize rectangle but pin its left-top corner
one change to mine:
Setting the idleTicks to 1 makes the animation smoother.
Simon
Code: Select all
on mouseDown
set the idleTicks to 1
put the topLeft of grc 1 into tLoc
end mouseDown
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Resize rectangle but pin its left-top corner
And yet another way:
Code: Select all
get the rect of grc 1
add 100 to item 3 of it
add 100 to item 4 of it
set the rect of grc 1 to it
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Resize rectangle but pin its left-top corner
Thank you everyone for your replies. I ended up finding a better solution to what I wanted to do .... open stack from an options menu...GENIUS!!!. I LOVE LIVECODE!!!!
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com