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
45
S
18
G
8
Posts: 509
Reputation: 8,513

Post » Sun Nov 23, 2014 6:00 pm

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

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
45
S
18
G
8
Posts: 509
Reputation: 8,513

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
113
Posts: 5,356
Reputation: 73,273


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests