I wouldn't recommend using sprite_create_from_surface in this way, as I *think* it will infinitely create sprites and fill up memory.
this is what I did...
instead of:
var texture = sprite_get_texture(sprite, subimg) var uvs = sprite_get_uvs(sprite, subimg)
just do:
var texture = surface_get_texture(surface) var uvs = texture_get_uvs(texture)