Quantcast
Channel: Answers by "chmodseven"
Viewing all articles
Browse latest Browse all 8

Answer by chmodseven

$
0
0
I'm not sure what the OP's intended goal was, but for me the challenge was that I wanted my button to provide a more generous clickable "hot zone" around the visible sprites layered on it, and without adding to draw calls. First I found that the Color alpha technique above does work, but at the expense of a draw call, since the renderer still treats each invisible Image as an object to draw. So I used the invisible texture approach also mentioned above (just a small blank texture 32*32 I created in Gimp that was entirely just an alpha channel) to use as my button's Source Image. And by saving it in the same ARGB format as my other sprites, I was then able to pack it into the same atlas as my other UI objects using Sprite Packer, and so achieved my invisible hot zone and did not accrue an extra draw call. As mentioned, it's not the prettiest solution, but at least there doesn't need to be draw call wastage if you pack the blank texture.

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>