With this function you can set the Y scale 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 scale to set on the Y axis and the sequence will be scaled by this amount. A scale of 1 indicates no scaling (1:1), smaller values will scale down (0.5, for example, will half the width of the sequence), larger values will scale up and negative values will flip the sequence about its origin and scale it unless the value used is exactly -1 (in which case the sequence is just flipped about its origin with no scaling).
It is very important to note that applying uneven scaling (eg: scaling the X axis by 3 and the Y axis by 2) to sequence elements that contain any instance which uses rotation, may cause issues with the instance drawing, collisions, culling, and many other things. Basically, if your sequence relies on any instance properties then we do not recommend that you combine uneven scaling along with instance rotation.
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_yscale(sequence_element_id, xscale)
Argument | Type | Description |
---|---|---|
sequence_element_id | Sequence Element ID | The unique ID value of the sequence element to target |
yscale | Real | The new Y axis scale value to apply to the sequence element |
N/A
if (seq_scale < 2)
{
seq_scale += 0.01;
layer_sequence_xscale(my_seq, seq_scale);
layer_sequence_yscale(my_seq, seq_scale);
}
The above code checks the value held in the seq_scale variable, and if it is less than 2 then it adds to it then uses the value to set the X and Y scale of the sequence element referenced in the variable my_seq.