Snap to grid ingame?

Discussion and feedback on Construct 2

Post » Mon Aug 08, 2011 10:43 pm

Hi,

is there a way to include the snap to grid tool in the menu to sprites in the game?

I could also get it with an invible object and set to position, but I thought of a little function with the square size of the grid (x and y pixels) for the object to fit.

Just an idea from me, I would love to see it implemented in future releases.

xeed
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Mon Aug 08, 2011 11:05 pm

It's easy to do with an event:

+ Every tick
-> Set sprite X to round(Sprite.X / 32) * 32
-> Set sprite Y to round(Sprite.Y / 32) * 32

where 32 is the grid cell size.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,508

Post » Mon Aug 08, 2011 11:11 pm

hey cool! (im using CN Classic) tnx alot!
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

Post » Tue Aug 09, 2011 1:41 am

this makes sense...

thanks for your help :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests