J
jwrose
Guest
Hello!
I've run into something that's causing me some problems and I'm curious if this is related to GM treating imported sprites (PNG files) differently than sprites drawn in GMS2. Below is a sample of some code I'm using to resize all enemies on the layer "enemy2". What's throwing me is that my placeholder enemies that were drawn in gamemaker are resizing just fine. My other enemies, which are imported png files, are not resizing. Is there something I need to do differently for imported sprites?
elements = layer_get_all_elements("enemy2");
for (var i = 0; i < array_length_1d(elements); i++)
{
if (layer_get_element_type(elements) == layerelementtype_instance)
{
var inst = layer_instance_get_instance(elements);
show_debug_message(inst);
inst.image_xscale = 0.5;
inst.image_yscale = 0.5;
}
}
Thanks!
I've run into something that's causing me some problems and I'm curious if this is related to GM treating imported sprites (PNG files) differently than sprites drawn in GMS2. Below is a sample of some code I'm using to resize all enemies on the layer "enemy2". What's throwing me is that my placeholder enemies that were drawn in gamemaker are resizing just fine. My other enemies, which are imported png files, are not resizing. Is there something I need to do differently for imported sprites?
elements = layer_get_all_elements("enemy2");
for (var i = 0; i < array_length_1d(elements); i++)
{
if (layer_get_element_type(elements) == layerelementtype_instance)
{
var inst = layer_instance_get_instance(elements);
show_debug_message(inst);
inst.image_xscale = 0.5;
inst.image_yscale = 0.5;
}
}
Thanks!