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
35
S
14
G
3
Posts: 38
Reputation: 4,836

Post » Wed Jan 18, 2017 10:24 pm

round(X/32)*32
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Thu Jan 19, 2017 12:08 am

EZ, thanks :D
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
35
S
14
G
3
Posts: 38
Reputation: 4,836


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests