Interpolate from just the right side.
dashnevada
Member Posts: 58
Hey guys.
Quick question. I have an actor that I want to change in width but just from the right side. If I use an interpolate rule to chance size.width to a bigger value the actor will increase in both left and right sides.. Is there a way to just make the actor width increase on the right side?
Thanks for your help
Quick question. I have an actor that I want to change in width but just from the right side. If I use an interpolate rule to chance size.width to a bigger value the actor will increase in both left and right sides.. Is there a way to just make the actor width increase on the right side?
Thanks for your help
Comments
One that interpolates size.width and the other that interpolates self.position.X.
This would require a lot of "tweaking" to get the effect exactly correct, and it may not even be possible. But if you increased the width but kept moving the object slowly to the left I believe you may be able to achieve the appearance of it moving to the right. But I don't know how this would look or if it would look dumb or not.
Good luck!
It definitely requires you to spend some time "tweaking" it, but it works. I'll post the demo project that I just made.
I appreciate it.
There's a bit of math(s) to do first to get the new X coordinate:
Decide on your new/final width.
Minus from that the starting width of the actor.
Divide this number by 2.
With this number, add it to the starting X position of your actor.
This final number will be used for the interpolating of the new X position.
Example: Actor is 100 wide. You want to make it grow to 300 pixels.
So 300 - 100 = 200
Divide by 2 = 100
Say your starting X pos is 187. So add 187 to the 100 = 287.
So:
Interpolate Attribute: self.Size. Width To 300
Interpolate Attribute: self.Position.X To 287.
Hope that helps. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Good luck!
edit- gyro and the doc have beaten me to it!!! I was wrong anyway... should have been the difference between 1/2 the new and old widths for the adjustment of the postion
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'll hang fire on working out my solution until later, if you can't find it.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
edit:
Oh and its by ORBZ from quite a while back so I have a feeling its original to him.
See, I sort of agreed with you!
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps