I’m sorry I tricked you a little bit, and I didn’t read your code in enough detail.
The texture0
accepts a texture (.texturec). It does not accept an atlas nor a tilesource.
And your example gets the texture name and hashes that. And that’s why it works.
Perhaps in the future, we can get a resource.get_texture(atlas)
function to facilitate this.