How do I save or download the current texture of an object

0 favourites
  • 5 posts
From the Asset Store
High quality sound effect pack, in the following categories: Dark, Mystical, Peaceful
  • Hey folks!

    I have a basic texture with a stack of effects I'm tweaking, I know how filechooser works for loading imgs to objects, but is there any way to save an object's current texture (being changed by FX) on my computer? I could just use the snapshot canvas feature, but I don't want to save the background color, or other sprites visible on screen, I just really want the selected objected saved with transparency included.

    Is there anything I could do? If there's nothing available with visual scripting, do you think I could add some javascript in a specific event to save the file? not sure how that work but I definitely have a few programmer friends that could help me with this.

    Thank you in advance for your help!

  • Move the object and the drawing canvas somewhere clean to take the snapshot then move it back. Or spawn a helper background sprite to cover everything else and then delete it. Or make everything else invisible and take the snapshot and make them visible again. You can do this by utilizing a dedicated layer for screenshots if you want, and hide/unhide all the other layers.

    I believe these can all be done within 1 tick so the user doesn't actually see anything.

  • Yeah I thought about doing that! But since it's a screenshot of the whole screen, it doesn't keep transparency right? I think that's the main issue for me here.

    I have an update though! I was looking at old posts and I thought about using the Drawing Canvas? Basically instead of saving a image of my object, I would paste the object's image (with effects) on the DrawingCanvas, then save the DrawingCanvas itself!

    But for some reason it just won't paste anything.

    This was my trigger

    I also tried the paste feature on a blank project, I had a sprite on screen and the canvas next to it, and the code was like :

    On start of layout, paste sprite (with effects) on DrawingCanvas

    And it didn't work either :( So maybe there's an issue with the canvas itself, I'm not sure. I feel like if the canvas works this would be a good way of keeping transparency?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, thank you so much for the example! The thing I didn't realized about Canvas is that you MUST have your sprite overlapping the canvas to paste its texture. I thought I could just "send" the texture to the canvas! I ended up adding an invisible canvas that covers the whole screen and with this small script :

    I paste the texture, download it, and it has transparency!!

    Thank you again for your help :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)