Table of Contents

Method AlignGridInRect

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

AlignGridInRect<TPoint>(IMap<Vector3, Vector3>, IExplicitShape<TPoint>, Func<TPoint, Vector3>, Func<TPoint, Vector3>, Bounds, HorizontalAlignment, VerticalAlignment)

It returns a Map that translate in such a way that it is aligned horizontally and vertically according to the given alignment.

public static IMap<Vector3, Vector3> AlignGridInRect<TPoint>(this IMap<Vector3, Vector3> map, IExplicitShape<TPoint> shape, Func<TPoint, Vector3> cellSize, Func<TPoint, Vector3> toVector, Bounds bounds, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)

Parameters

map IMap<Vector3, Vector3>

Base map where you apply this call.

shape IExplicitShape<TPoint>

Shape used in the map.

cellSize Func<TPoint, Vector3>

This function is used to calculate the size of a cell.

toVector Func<TPoint, Vector3>

A function that can convert the point type to a Vector3

bounds Bounds

Bounds of the Map.

horizontalAlignment HorizontalAlignment

Type of horizontal alignment to apply.

verticalAlignment VerticalAlignment

Type of vertical alignment to apply.

Returns

IMap<Vector3, Vector3>

Type Parameters

TPoint