Object resize when dragged into another object
Moderators: heatherlaine, kevinmiller, robinmiller, malte
Object resize when dragged into another object
I have an object Rectangle and another rectangle smaller than previous one. What I want is when I drag the larger Rectangle on smaller rectangle the larger rectangle changes it size into the smaller rectangle and is rested upon the smaller one. But in the end both of are of same size. With one rectangle over the other.
Or in simple words... can an object's size be changed after it is drag at a particular location.
Is it possible...??
Or in simple words... can an object's size be changed after it is drag at a particular location.
Is it possible...??
Re: Object resize when dragged into another object
yes.. You can either set the width and height properties, or (even easier) set the rectangle property.. setting the rectangle property will cause the control to get the same dimensions, as well as moving it to overlap with the other control
Code: Select all
set the width of control "a" to (the width of control "b")
Code: Select all
set the rectangle of control "a" to (the rectangle of control "b")
Re: Object resize when dragged into another object
And in animationEngine there is even a handler to do so (and animating it even). Please read the documentation on aeChangeRect.
Re: Object resize when dragged into another object
You have thought of everything in there haven't you?
Re: Object resize when dragged into another object
Thanks a lot..... Malte and Shaosean....
It worked.... I used Animation Engine
Just one more thing.... Can same thing be done for Polygon....???
Is their any command like "aeChangePolygon"
What if I want to drag the Polygon into another polygon of different size....
Also what if I had to do a vice-versa of this.... Bringing the rectangle back to its original shape by dragging...
It worked.... I used Animation Engine
Just one more thing.... Can same thing be done for Polygon....???
Is their any command like "aeChangePolygon"
What if I want to drag the Polygon into another polygon of different size....
Also what if I had to do a vice-versa of this.... Bringing the rectangle back to its original shape by dragging...
Last edited by Surbhit29 on Sat Aug 18, 2012 2:49 pm, edited 1 time in total.
Re: Object resize when dragged into another object
Hi,
Changing the rect for a polygon should just scale it nicely. However it is adviseable to remember the original points of the poly (if it is not a regular poly)
cheers,
Malte
@Shao: almost
Changing the rect for a polygon should just scale it nicely. However it is adviseable to remember the original points of the poly (if it is not a regular poly)
cheers,
Malte
@Shao: almost
Re: Object resize when dragged into another object
Hi Malte..
I want to drag a Polygon into another Polygon..... Not a rectangle into Polygon.....
How can that be done...?
I want to drag a Polygon into another Polygon..... Not a rectangle into Polygon.....
How can that be done...?
Re: Object resize when dragged into another object
Hi,
first of all, you need the logic when the drag is considdered being a valid drag. This might be if the location of the poly is inside the area of the other poly, or already when both polys collide. Once you decided when you considder a drag being valid, you still can work with the rect property. Each control has a (bounding) rectangangle. So assuming both polys have the same shape you coud do a
set the rect of grc "aPoly" to the rect of grc "bPoly"
or use aeChangeRect to do it with a little animation.
Hth,
Malte
first of all, you need the logic when the drag is considdered being a valid drag. This might be if the location of the poly is inside the area of the other poly, or already when both polys collide. Once you decided when you considder a drag being valid, you still can work with the rect property. Each control has a (bounding) rectangangle. So assuming both polys have the same shape you coud do a
set the rect of grc "aPoly" to the rect of grc "bPoly"
or use aeChangeRect to do it with a little animation.
Hth,
Malte
Re: Object resize when dragged into another object
Hi Malte..
Polygon is outside another polygon... I want to drag the polygon which is outside into another polygon... And when dragged inside.. The polygon which is outside changes its size and fit in the second polygon...
How can it be done using aeChangeRect..?
Polygon is outside another polygon... I want to drag the polygon which is outside into another polygon... And when dragged inside.. The polygon which is outside changes its size and fit in the second polygon...
How can it be done using aeChangeRect..?
Re: Object resize when dragged into another object
aeChangeRect the long ID of grc "outerPoly",the rect of grc "innerPoly",tTimeInMillisecs
All the best,
Malte
All the best,
Malte
Re: Object resize when dragged into another object
Hi Malte
It is showing an error, "handler can't find handler near aeChangeRect"
It is showing an error, "handler can't find handler near aeChangeRect"
Re: Object resize when dragged into another object
Is animationEngine loaded?
Re: Object resize when dragged into another object
Happens to the best of us
Re: Object resize when dragged into another object
Thnx Malte and Shaosean.....
You guys are helping me a lot..
You guys are helping me a lot..