Changing height while constraining 'starting point' position
Lokitoes
Member, PRO Posts: 187
Hi all,
I have a question about changing the size of an image. I don't quite know how to explain this well, so I will do my best. Essentially, I want my image to grow upwards, while the base of the image stays in its absolute location. When I constrain the Y value using sin or cos, it grows in and out from the middle of the image. Which isn't quite right. I want it to grow from one end of the image, not the middle. So that the image elongates at the top of the image, while the base of the image remains at its usualX and Y coordinates. Imagine a sprite image of a tree being stretched upwards, while the base of the tree remains on the ground, rather than it growing in both directions on the Y axis. Can anyone help? :)
Comments
Constrain the position of the image to the desired position of the bottom + half the actor's height. See the attached project for a very simple example.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
ahhh thank you thank you thank you @Armelline ! And howdy! Hope you are doing well!
How would I turn it around so that it grows 'downwards' rather than upwards?
All good thanks! I have no doubt you're working on something unique and interesting!
Calculate the position of the top of the actor in the same way (position+height/2) and then just swap the + in the constrain to a -
TopPosition-(self.size.height/2)
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support