part_system_position

Sets the position of the particle system.

Syntax:

part_system_position(ind, x, y);


Argument Description
ind The index of the particle system to change.
x The new x coordinate of the particle system.
y The new y coordinate of the particle system.


Returns: N/A


Description

With this function you can set the base position for the particle system relative to the (0,0) position of the room, meaning that all further particle functions relating to this system will now be drawn relative to the new position. By default this position is always (0,0), but in some very special circumstances you may wish to change this to something else.

NOTE: This function will change everything within the particle system, so if you have an emitter at position (100,100) and then set the particle system position to (0,100), the emitter will now draw at (100,200). The same goes if you shift the system and then create the emitter, as even though you create it at (100,100) it will be drawn at (100,200).


Example:

if mouse_check_button_pressed(mb_left)
   {
   part_system_position(global.Sname, mouse_x, mouse_y);
   }

The above code will check for the press of the mouse button and if it detects one, the particle system indexed in the global variable "Sname" is shifted to the mouse x/y position


Back: Particle Systems
Next: part_system_destroy
© Copyright YoYo Games Ltd. 2018 All Rights Reserved