path_change_point(index, n, x, y, speed);
参数 | 描述 |
---|---|
index | The index of the path to change the point of. |
.n | The defining point to change the attributes of. |
x | The new x coordinate (relative to the path) of the point. |
y | The new y coordinate (relative to the path) of the point. |
speed | The new speed factor of the point. |
返回: N/A(无返回值)
With this function you can change the position and/or the speed
factor of any point previously defined for a path (the path can
have been created in the path editor or through code using path_add).
for (var i = 0; i < path_get_number(path0); i ++)
{
var px = path_get_point_x(path0, i) + 32 - random(64);
var py = path_get_point_y(path0, i) + 32 - random(64);
path_change_point(path0, i, px, py, 100);
}
The above code loops through all the points in the path indexed
as "path0" and re-positions all the points to a random position
within an area of 64x64 pixels.