part_system_position

Sets the position of the particle system.

Syntax:

GML Code Example

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:

GML Code 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





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here