Merge pull request #81267 from Chaosus/astargrid_isometric_mode

Add isometric cell shape mode to `AStarGrid2D`.
This commit is contained in:
Rémi Verschelde
2024-01-04 14:25:00 +01:00
3 changed files with 65 additions and 1 deletions

View File

@ -157,6 +157,9 @@
</method>
</methods>
<members>
<member name="cell_shape" type="int" setter="set_cell_shape" getter="get_cell_shape" enum="AStarGrid2D.CellShape" default="0">
The cell shape. Affects how the positions are placed in the grid. If changed, [method update] needs to be called before finding the next path.
</member>
<member name="cell_size" type="Vector2" setter="set_cell_size" getter="get_cell_size" default="Vector2(1, 1)">
The size of the point cell which will be applied to calculate the resulting point position returned by [method get_point_path]. If changed, [method update] needs to be called before finding the next path.
</member>
@ -238,5 +241,17 @@
<constant name="DIAGONAL_MODE_MAX" value="4" enum="DiagonalMode">
Represents the size of the [enum DiagonalMode] enum.
</constant>
<constant name="CELL_SHAPE_SQUARE" value="0" enum="CellShape">
Rectangular cell shape.
</constant>
<constant name="CELL_SHAPE_ISOMETRIC_RIGHT" value="1" enum="CellShape">
Diamond cell shape (for isometric look). Cell coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right.
</constant>
<constant name="CELL_SHAPE_ISOMETRIC_DOWN" value="2" enum="CellShape">
Diamond cell shape (for isometric look). Cell coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left.
</constant>
<constant name="CELL_SHAPE_MAX" value="3" enum="CellShape">
Represents the size of the [enum CellShape] enum.
</constant>
</constants>
</class>