path_change_point

Changes an existing path points attributes.

Syntax:

path_change_point(index, n, x, y, speed);


Argument Description
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.


Returns: N/A


Description

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).


Example:

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.

Back: Changing Paths
Next: path_insert_point
© Copyright YoYo Games Ltd. 2019 All Rights Reserved