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
18
S
4
G
5
Posts: 406
Reputation: 5,172

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
415
S
247
G
92
Posts: 25,279
Reputation: 200,817

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
18
S
4
G
5
Posts: 406
Reputation: 5,172


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests