Note that the function requires you to duplicate the sprite resource for it to work as it can't be used on compiled sprites... which in turn means a new texture page and an additional texture swap every time the duplicated sprite is used. So, use with care!