Beispiel #1
0
    private GridPointPair DoGridPointPair(int index, Direction direction)
    {
        GridPointPair gridPointPair = new GridPointPair();

        Vector2 start = new Vector2();
        Vector2 end   = new Vector2();

        if (direction == Direction.Vertical)
        {
            // then x has the offset
            start.x = index * GridSpacing;
            start.y = 0;

            end.x = start.x;
            end.y = GridBounds.height;
        }
        else
        {
            // y has the offset
            start.x = 0;
            start.y = index * GridSpacing;

            end.x = GridBounds.width;
            end.y = start.y;
        }

        gridPointPair.StartVertex = new Vector2(start.x, start.y);
        gridPointPair.EndVertex   = new Vector2(end.x, end.y);

        return(gridPointPair);
    }
Beispiel #2
0
 public GridLine()
 {
     _gridVertices = new GridPointPair();
 }
Beispiel #3
0
    private GridPointPair DoGridPointPair(int index, Direction direction)
    {
        GridPointPair gridPointPair = new GridPointPair();

        Vector2 start = new Vector2();
        Vector2 end = new Vector2();

        if (direction == Direction.Vertical)
        {
            // then x has the offset
            start.x = index * GridSpacing;
            start.y = 0;

            end.x = start.x;
            end.y = GridBounds.height;
        }
        else
        {
            // y has the offset
            start.x = 0;
            start.y = index * GridSpacing;

            end.x = GridBounds.width;
            end.y = start.y;
        }

        gridPointPair.StartVertex = new Vector2(start.x, start.y);
        gridPointPair.EndVertex = new Vector2(end.x, end.y);

        return gridPointPair;
    }
Beispiel #4
0
 public GridLine()
 {
     _gridVertices = new GridPointPair();
 }