[Request] Compare Sprite SCALE

Discussion and feedback on Construct 2

Post » Sun Aug 18, 2013 6:02 pm

Hi Ashley

I noticed you can easily set an object's scale, but can't get this value anywhere. I would benefit a lot from this, since I'm making a compound object, and I have to animate the scale of all its objects at the same time.

I think it would be a nice addition to C2!
B
108
S
40
G
11
Posts: 456
Reputation: 13,782

Post » Sun Aug 18, 2013 6:24 pm

Sprites don't have an overall scale. If it's twice as wide but half as tall, what's its scale? 0.5, 1 or 2? None of the answers are really correct.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Sun Aug 18, 2013 7:17 pm

How about an expression for ScaleX and other for ScaleY?

Maybe would also make sense to have separate parameters to set ScaleX and ScaleY independently like the size does.
Scirra Employee
B
153
S
53
G
17
Posts: 710
Reputation: 17,825

Post » Sun Aug 18, 2013 11:29 pm

The "Scale" event is just a width/height multiplier. If you want to change the height/width of an object using a scale-like event, just multiply them for a number.
B
124
S
43
G
41
Posts: 849
Reputation: 28,235

Post » Mon Aug 19, 2013 3:05 pm

The idea was to store the scale in relation to the original sprite size.
(So setting the scale to 2 would double the sprite size, and later setting it to 0.5 would not bring it back to 100%, but make it 50%)


Well, I managed to track the object's scales by using width/imageWidth. It turned out nicely.

The test:
www.gamma-beam.com/construct/bloomsgammabeam2013-08-19 15:08:24
B
108
S
40
G
11
Posts: 456
Reputation: 13,782

Post » Wed Oct 09, 2013 11:04 pm

i usually add a variable scale on the object and set it to 1 as default,
then i add or subtract from this variable and set the object scale to that variable.
Image
B
78
S
29
G
12
Posts: 515
Reputation: 12,559

Post » Thu Oct 10, 2013 1:53 am

I agree with Lof that is what I do also
B
37
S
9
G
5
Posts: 437
Reputation: 6,094


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests