stretch actor
wollty
Member Posts: 102
I would like to extend an actor (stretch)
for example when you touch with a finger to stretch an arm
from left to right
as in toca taylor
lengthen the dress or the sleeve
I did a test but not good
the right movement is from left (start) to the right (end)
https://www.dropbox.com/sh/sikt71zhgttd4hv/vuQ26y5l-g
help me, please
thanks
for example when you touch with a finger to stretch an arm
from left to right
as in toca taylor
lengthen the dress or the sleeve
I did a test but not good
the right movement is from left (start) to the right (end)
https://www.dropbox.com/sh/sikt71zhgttd4hv/vuQ26y5l-g
help me, please
thanks
Comments
or use change size?
or maybe use the spawn?
help me...
thanks
the tricky part is the stretch
you'll need to record the initial touch position of Y (this is your offset number) so make a self attribute called TouchOffsetY and one called positionoffset
What you then have to do is constrain the Y of the actor you want to stretch to the touch.y position then divide it by 2 minus the offset so it will stay in place.
so...(this would be for the shirt example)
when touch is inside (or pressed)
(these will store the original Y positions of the touch and the actor at the start of the touch)
change self.TouchOffsetY to device.touch1.y
change self.positionOffset to self.position.y
(now that we know where the actor is we can start to alter it.)
// stretch
constrain self.size.height to self.size.height + (device.touch1.y - TouchOffsetY)
// keeps it in place
constrain self.position.Y to ( device.touch1.y - positionOffset )/2 (dont forget to divide it by 2 because actors origin positions are in the middle.)
This is all off the top of my head, I haven't had a chance to proof it, but I'm pretty sure this is the direction to take. plus its late, anyway I hope you gain some incite at least. Anyway you'll have to mess around until it does what you want.
but I must have done something wrong ...
https://www.dropbox.com/s/ha6hkhq9ajpu2o3/stretch05.gameproj.zip
or to the right
or to the up
or to the down
It's possible whit gamesalad?
maybe it's not possible
i don't know...
sorry for my english
thanks
and I made this
https://www.dropbox.com/s/z0wi0erj4p9uvaj/stretch06.gameproj.zip
but it is not what I want
I wish I could drag with touch finger the extremes of the actor
to lengthen
sorry for my english
thanks for help
I can 'stretch/shrink' the actor using touch while keeping the original base position.
edit---see post below.
cheers
constrain self size height to "touch" ???
i make a test
thanks
cheers
https://www.dropbox.com/s/si9r3649jrwkiui/stretch07.gameproj.zip
but... is not good
thanks for help me
sorry for my english
might as well go
I'll do the tests in my game with my actor
even better would extend from the ends of the Actor
thanks
https://www.dropbox.com/s/v8uqdv1ldgxp8ly/stretch07.gameproj.zip
Also, if you want to 'touch' the end of the actor to stretch instead of anywhere in the actor, than you can create invisible actor/s and constrain to your main actor. Warning--- I am a rookie, hence there may be a better way to do all this.
cheers