How do I get object scale

Get help using Construct 2

Post » Sun Nov 23, 2014 4:06 pm

I tried searching for this and was surprised I could not find it.
Is there not a way to get the scale of an object?
B
48
S
22
G
10
Posts: 611
Reputation: 10,201

Post » Sun Nov 23, 2014 6:00 pm

Sprite.Width / Sprite.ImageWidth
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,710

Post » Mon Nov 24, 2014 2:39 am

ramones wrote:Sprite.Width / Sprite.ImageWidth


thanks, but I was looking for something more convenient.

ie: setting scale is easy, simply set scale = x
usually if you can set something, you can get it just as easy
B
48
S
22
G
10
Posts: 611
Reputation: 10,201

Post » Mon Nov 24, 2014 2:51 am

It's discussed elsewhere but and expression to get the scale can be ambiguous if the width or height is changed to have a different aspect ratio. Like tall and skinny or short and wide.

If you're just setting the size with set scale and want to get it later and easy way would be to save the scale you set to a instance variable.
B
94
S
33
G
123
Posts: 5,447
Reputation: 78,457


Return to How do I....?

Who is online

Users browsing this forum: JarrydHuntley, RalfD and 55 guests