How do I round to every the closest multiple of a value?

Get help using Construct 2

Post » Wed Jan 18, 2017 10:16 pm

How can I round the position of a sprite to every 32 pixels?
Sprite.x = Mouse.x (rounded to closest multiple of 32)
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
32
S
11
G
3
Posts: 37
Reputation: 4,377

Post » Wed Jan 18, 2017 10:24 pm

round(X/32)*32
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Thu Jan 19, 2017 12:08 am

EZ, thanks :D
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
32
S
11
G
3
Posts: 37
Reputation: 4,377


Return to How do I....?

Who is online

Users browsing this forum: armen1997, Syazanie Amirin and 11 guests