path_add

Adds an empty path and returns its index.

语法:

path_add();


Returns: Real.


描述

With this function you can create a path in GameMaker Studio 2 without using the path editor. this function will return the index of the path which should be stored in a variable and used as the reference for that path from then on. Please note that the created path is empty ie: it has no points defined, so you will then have to use the other available functions to add points to the path or be using mp_grids to generate the path. Once you have finished using the path, or wish to create a new one and store its index in the same variable you should first delete the old path with path_delete to prevent memory leaks which can eventually crash your game.

重要!该函数在试用版(Trial License)产品中可用。



例如:

global.newpath = path_add();

This will create a new path and assign its index to global.newpath.


上一页: Changing Paths
下一页: path_add_point
© Copyright YoYo Games Ltd. 2018 All Rights Reserved