With this function you can set the angle of rotation for the given sequence element. You supply the sequence element ID as returned by layer_sequence_create() or by one of the layer element functions along with the new angle to set and the sequence will be rotated about its origin to the new position. Angles in GameMaker are calculated with 0º to the right, and go anti-clockwise - so 90º is up, 180º is left and 270º is down - and the default angle for a sequence would be 0º.
IMPORTANT If your sequence has any instances in it, these instances shouldn't change their image_xscale / image_yscale / image_angle / x / y variables as they will be overwritten when the sequence updates each step after starting to be played. You can check in_sequence and only update the properties of such an instance when this variable is false.
layer_sequence_angle(sequence_element_id, angle)
Argument | Type | Description |
---|---|---|
sequence_element_id | Sequence Element ID | The unique ID value of the sequence element to target |
angle | Real | The new angle to rotate the sequence element to |
N/A
if (current_angle < 90)
{
current_angle += 1;
layer_sequence_angle(my_seq, current_angle);
}
The above code checks the value held in the current_angle variable, and if it is less than 90 then it adds to it then uses the value to set the angle of the sequence element referenced in the variable my_seq.