Hi
I’d like to render a playing card as a single sprite. Cards have both a front and a back texture. In Unity, I was able to handle this at the material level. Is there something similar in defold? I’d rather not have 2 sprites for every card if I can help it.
You should have a sigle sprite and change what the sprite shows using sprite.play_flipbook. Please note that a flipbook here may also be a single image.
In general, in Unity you can change everything in runtime. As far as I understand, a material in unity keeps track of the texture region to show (a sprite). It is way different from Defold for which “material” is very close to shaders.
In Unity you can set the material up to display a different texture for the back face and front face of a sprite. It’s useful for billboarding things with a back and a front and for my particular use case. If you rotate the sprite around the x or y axis you get shown a different side.
I see, you should be able to calculate that in a shader, but it will be easier when we ship multitexture support for sprites (which should be available in the next version).