1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GMS 2 Changing the sprite of a tileset from directory

Discussion in 'Programming' started by mikix, Dec 4, 2019.

  1. mikix

    mikix Member

    Joined:
    May 2, 2017
    Posts:
    403
    How do I change the sprite of a tileset? I am trying to replace my tileset´s sprite with a tileset in my working directory.

    sprite_replace and sprite_add is not working.

    Tested in draw event and step event:
    Code:
    if keyboard_check_pressed(ord("R"))
    {
        sprite_add(working_directory + "tile.png",-1,true,true,16,16);
        sprite_replace(spr_tropical_tileset,working_directory + "tile.png",-1,true,true,16,16);
    }
    It works if you want to change an object but I want to change the tileset, not the object.
     
    Last edited: Dec 4, 2019

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