# path_get_point_x

## Returns the x coordinate of a given path's given
defining point.

### 语法：

path_get_point_x(index, n);

参数 |
描述 |

index |
The index of the path to check. |

n |
The point identity to check. |

**Returns:** Real.

### 描述

This function will return the x position (in room coordinates)
of the point that you input for the path that you index. If the
point is outside of the range of the path (ie: a path has 8 points
and you ask for the x position of point 10) then a value of 0 will
be returned.

### 例如：

if path_position = 1

{

var i;

i = floor(random(path_get_number(mypath)));

x = path_get_point_x(mypath, i);

y = path_get_point_y(mypath, i);

path_position = (1 / path_get_number(mypath)) * i;

}

The above code will check to see if an instance is at the end of
a path. If it is it will then choose a random point on the path and
move the instance to that point.

##### © Copyright YoYo Games Ltd. 2018 All Rights Reserved