Risorse – Path

Le funzioni seguenti forniscono informazioni su un percorso:

path_exists() ind Dato l’indice di un percorso restituisce: esiste?, il nome, la lunghezza, il tipo di connessione (0=straight, 1=smooth), chiuso?, la precisione, il numero di punti
path_get_name() ind
path_get_length() ind
path_get_kind() ind
path_get_closed() ind
path_get_precision() ind
path_get_number() ind
path_get_point_x() ind
n
Dato l’indice di un percorso e l’indice di un punto (o per il primo punto) restituisce: la coordinata x, la coordinata y, il fattore di velocità
path_get_point_y() ind
n
path_get_point_speed() ind
n
path_get_x() ind
pos
Dato l’indice di un percorso e la posizione pos (compresa tra 0 e 1) restituisce: la coordinata x, la coordinata y, il fattore di velocità
path_get_y() ind
pos
path_get_speed() ind
pos

 

Modificare Script

It is possible to create paths and to add points to paths.
However, never change a path that is being used by an instance.
This can lead to unexpected results.

The following functions exist:

path_set_kind() ind
val
Sets the kind of connections of the path with the given index (0=straight, 1=smooth).
path_set_closed() ind
closed
Sets whether the path must be closed (true) or open (false).
path_set_precision() ind
prec
Sets the precision with which the smooth path is calculated (should lie between 1 and 8).
path_add() Adds a new empty paths.
The index of the path is returned.
path_delete() ind Deletes the path with the given index.
path_duplicate() ind Creates a duplicate copy of the path with the given index.
Returns the index of the copy.
path_assign() ind
path
Assigns the indicated path to path ind.
So this makes a copy of the path.
In this way you can easily set an existing path to a different, e.g. new path.
path_append() ind
path
Appends the indicated path to path ind.
path_add_point() ind
x
y
speed
Adds a point to the path with the given index, at position (x,y) and with the given speed factor.
Remember that a factor of 100 corresponds to the actual speed.
Lower values mean slowing down and higher mean speeding up.
path_insert_point() ind
n
x
y
speed
Inserts a point in the path with the given index before point n, at position (x,y) and with the given speed factor.
path_change_point() ind
n
x
y
speed
Changes the point n in the path with the given index to position (x,y) and the given speed factor.
path_delete_point() ind
n
Deletes the point n in the path with the given index.
path_clear_points() ind Clears all the points in the path, turning it into an empty path.
path_reverse() ind Reverses the path.
path_mirror() ind Mirrors the path horizontally (with respect to its center).
path_flip() ind Flips the path vertically (with respect to its center).
path_rotate() ind
angle
Rotates the path counter clockwise over angle degrees (around its center).
path_scale() ind
xscale
yscale
Scales the path with the given factors (from its center).
path_shift() ind
xshift
yshift
Shifts the path over the given amount.
Notice: This work is licensed under a BY-NC-SA. Permalink: Risorse – Path

Comments are closed.