1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code sprite_save() no bitmap data available [SOLUTION]

Discussion in 'GameMaker Studio 2 Community Tech Support' started by dreenot, Aug 12, 2019.

  1. dreenot

    dreenot Member

    Joined:
    Mar 28, 2018
    Posts:
    4
    I had a problem with this function that took me a long time to figure out.
    I read a lot of threads and people didn't get a solution.
    So I found this answer in a Russian forum.

    The function sprite_save() does not work with sprites created previously in the game.
    It only works with dynamically created ones.

    This should be specified in the documentation.

    But there is an easy solution to do it:

    sprite_variable=sprite_duplicate(sprite_name_not_string);
    sprite_save(sprite_variable, 0, "name.png");

    Remember to include the image index in the second parameter

    In my case it was saved in C:\Users\{{Username}}\AppData\Local\project_name
     
    SupernaturalCow likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice