Kill actor but leave actor image in scene..

MikePL80

  • Posts: 45
Hi,

I was just tinkering and wondered if it is possible to kill off an actor but to somehow leave or draw its image to the scene when I'm done with it?

I basically want to free up memory by killing the actor but I would still like it to be visible and become part of the background.

Thanks

Mike

« Last Edit: February 14, 2016, 02:13:25 pm by MikePL80 »

ceosol

  • *
  • Posts: 2274
Image API

set image to image of self
set instance to instance of image
attach instance to x, y of self
kill self

MikePL80

  • Posts: 45
Thanks Ceosol

This appears to be what I'm looking for but would it be possible for someone to show me it as a screen shot from Stencyl maybe?
I've struggled with the image API before and gave up in the end..

Thanks

Mike

ceosol

  • *
  • Posts: 2274
It is almost exactly as I wrote it. Just find those blocks :)

MikePL80

  • Posts: 45
Well this is the blocks I used but when I test it the actor is killed but no image is draw  :-\

Have I done it wrong somewhere?

Thanks

MikePL80

  • Posts: 45
Ok I offset the drawn image to test it and it is being draw so that works but the problem I have is when I kill the actor the drawn image is also being killed..

Is there a way to attach it to the scene rather than self?

Thanks

MikePL80

  • Posts: 45
I found the (attach to screen block)

Thanks for your help Ceosol

ceosol

  • *
  • Posts: 2274
Sure, no problem. As you noticed, attaching to self and then killing self will also kill the picture :)