Sprite Property: "texture0" (SOLVED)

The resource.set_texture() function require a path as its first argument. When drawing pixels to a texture, we generally use local resource_path = go.get("#sprite", "texture0"), then pass it into the function.

Where does the "texture0" come from? I understand that its a property of the sprite component, however I do not see this in any Defold documentation. Also wondering what other properties the sprite component might have.

1 Like

With some reservation that the documentation might miss some properties. Please let us know if it does!

3 Likes

Thanks, missed that page. The texture0 refers to the sprite component’s underlying atlas, correct?

1 Like

It’s easily missed!
(Note that the search function in the api documentation is much better nowadays!)

Correct, it’s the entire atlas.

3 Likes