GMS 2 Manipulating with Asset Layer elements using Code

Lady Glitch

Member
Is there any way to get / change sprite's coordinates / scale / rotation in Asset Layer using code?

Something like:
Code:
var a = layer_get_all_elements(layer_get_id("AssetLayer"));
for (var i = 0; i < array_length_1d(a); i++;)
{
    if layer_get_element_type(a[i]) == layerelementtype_sprite
    {
        if layer_sprite_get_sprite(a[i]) == spr_Sprite1
        {
                a[i].x -= 100;
        {
    }
}
 

NightFrost

Member
Yes, the various layer_sprite_get_* (getters) and layer_sprite_* (setters) commands. They need the layer sprite id from either layer_sprite_create or layer_sprite_get_id commands for targeting.
 
Top