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
33
S
12
G
3
Posts: 38
Reputation: 4,553

Post » Wed Jan 18, 2017 10:24 pm

round(X/32)*32
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Thu Jan 19, 2017 12:08 am

EZ, thanks :D
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
33
S
12
G
3
Posts: 38
Reputation: 4,553


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests