[REQUEST] Resize sprite to image point instead of origin?

Post your work in progress addons and get feedback

Post » Fri Dec 09, 2016 7:26 am

I have a player animations Sprite that's pinned to a container and its origin is in the centre. It needs to be here for Gravity switch reasons. I want to resize the Sprite so it squashes, but I want it to squash to its feet as if the origin was at the bottom. I can't resize and counter it by repositioning the sprite because it's pinned and I can't temporarily un pin as it would be during gameplay. Is it possible for someone to come up with a behaviour that would allow resizing and defining the centre point as an image point rather than the origin?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sun Dec 18, 2016 4:07 am

can you show us what exactly you want to achieve?

P.S are you trying to achieve the old mario mushroom growth? cause you could do the resizing on original point unpin and then move as you said its not possible, but keeping in mind original old mario was pausing the gamespeed while he was growing or shrinking, and you couldn't control it while the effect was happening.
B
76
S
22
G
69
Posts: 1,353
Reputation: 43,833

Post » Sun Dec 18, 2016 4:28 am

I would suggest getting rid of the pin behavior, and making your own with some trig.
x+cos(angle)*distance
y+sin(angle)*distance
That lets you use a variable to decide where the offset container will be.
variableo=0, set angle to n, set distance to n
variableo=1, set angle to t, set distance to t
You just have to figure out what those values are.
Image ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278


Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest