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
42
S
18
G
8
Posts: 495
Reputation: 8,410

Post » Sun Nov 23, 2014 6:00 pm

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

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
42
S
18
G
8
Posts: 495
Reputation: 8,410

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
92
S
32
G
107
Posts: 5,274
Reputation: 69,959


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 9 guests