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); }
public GridLine() { _gridVertices = new GridPointPair(); }
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; }
public GridLine() { _gridVertices = new GridPointPair(); }