Friday, May 22, 2015

inkscape - Copy, paste, move colored squares - but keep them aligned to the grid


I am developing a word game for iOS and would like to use an SVG file as the gaming board.


The SVG file (author: Denelson83, Wikimedia Commons) is almost perfect for my game - except for displaced colored squares.


My question is:


How could I please copy such a colored square (is it a Group?), then paste it and move the new square to a new spot - but still keep it aligned to the grid?


screenshot


As an Inkscape newbie I have already found out, that I can jump to the "original" with Shift-D.


And I can hold CTRL key to move objects horizontally or vertically.


But I still don't understand how to keep the moved square aligned to the grid (which also seems to be in a separate layer - so how did the author manage to keep all squares aligned to the grid?)


And also I can't find some view/dialog/toolbar, which would show me the coordinates of the object being dragged by me (I only see the coordinates of the mouse pointer at the bottom right). If I could see/change those coordinates, then I could (in a tiresome way) calculate and set the coordinates for the new squares...



UPDATE:


I've toggled Snap to grid and also enabled showing the grid:


grid


but the square doesn't snap to the grid when I drag it.


And also the grid is too small and I can't find how to make its cells broader.


UPDATE 2:


I have found where to set the grid size (15 x 15) and offset:


properties


But while the grid looks ok now and snaps too - it snaps in the wrong places as shown below.


snapping



Why doesn't the grid snap at the square's borders?


Is this maybe a bug in Inkscape? How to workaround it please?


UPDATE 3: I've received an offline advice to hold ALT while dragging a square



Answer



In order to snap the whole group, you need to enable "Snap bounding box corners", by clicking on the proper icon in snap toolbar:


Snap bounding box corners


Usually this flag isn't enabled and you see the snap to text baseline:


Default snap to text


Enabling this flag you can see the snap to the bounding box of the group (or the selection);


Snap to bounding box corners



You can change the behaviour of the snap using the other buttons in the toolbar. See here for reference.


Be aware that the snap depends from the position of your mouse in the selection: if you begin to drag the group with the mouse near the text, the snap would be related to the text, if your mouse is near the top-left corner of the box, the snap would be related to the top-left corner of the box (if "Snap bounding box corner" is enabled), and so on.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...