Help needed: snap to grid

I’m creating a map with 50x50 px grid.

  1. I want buildings to be freely deployed. It currently snaps to center of the girds. But I don’t want that, I want it to cover each box correctly. What to do?

  2. I also want the user to be able to rotate the buildings but the rotate command does not work for now.

Hope to get some tips. Thanks.

I see one possible option.

In the Grid section of the map editor select “Vertices are legal locations”. Then the building should also snap to a vertices as well as the center of a square. That way the building can be snapped to the grid and will still allow you to snap playing pieces to the center of a square. But I’m not sure how this will affect stacking within a building. You may need to create piece layers.

Thanks. But I think I now accept the fact that it snaps to the center.
I will continue working with this limitation.

You can sometimes work around this by offsetting the image of the piece that needs to snap to a different location. Either by using an offset layer, or by changing the size of the image and adding a transparent border on two sides.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jan 23, 2010, at 4:44 AM, jomni wrote:

OK, I was at first a bit confused by the question, but then I noticed
the attached picture.

The fundamental problem you have is that your buildings have an even
number of squares in them. That means you can’t have them snap to
the center of a grid square and be aligned with the grid. The
geometry just doesn’t work out.

The simplest solution would be to make the buildings sizes be odd
numbers of squares. So if you had 3x3 or 5x5 buildings, it would all
work out.

Another solution would be to allow snapping to the corners of grid
squares. That would allow the center of an even-sized piece (which
is an intersection of squares) to be located on a grid corner.

There are other solutions such as including offsets for the “center
point” used for snapping, but they have the drawback that some point
other than the center of the piece is used to determine the snapping
behavior. This can sometimes be rather confusing for users, so I
wouldn’t suggest using this approach.

When you say it doesn’t work, does that mean that you have a rotate
command for the pieces, but choosing it doesn’t do anything? Or is
there no rotate command available at all?

Often this can be a problem with the order of traits. If you move
the location of the rotate trait in the list, you can often solve
problems like this.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)