GameMaker instance create (and resize)

So I have a thing that creates a flame when you click... problem is I use a sprite thats too big. I dont want to manually resize the sprite. I want to be able to set the size in the command when it creates. How can I do that?

Left Pressed
Code:
instance_create_layer(mouse_x, mouse_y, "Flame", oFireSml);
 

Rob

Member
Code:
flame = instance_create_layer(mouse_x, mouse_y, "Flame", oFireSml);

flame.image_xscale = 0.5;
flame.image_yscale = 0.5;
flame will store the instance id of the instance you just created and then you can set the image variables from there (you can also use "with flame{ [code here] }" to access it too

One thing to note is your flame sprite might look crap after altering the image size
 
Code:
flame = instance_create_layer(mouse_x, mouse_y, "Flame", oFireSml);

flame.image_xscale = 0.5;
flame.image_yscale = 0.5;
flame will store the instance id of the instance you just created and then you can set the image variables from there (you can also use "with flame{ [code here] }" to access it too

One thing to note is your flame sprite might look crap after altering the image size
Oh my Lawd.... that is so simple. Thanks Rob. I feel silly now. But works like a charm. Thx friend.
 
  • Like
Reactions: Rob
Top