Touch event on 2d text
-
Hi, Marco!
No, we can't detect tap on Text. But this will be fixed in the next studio release!
Here is what you can do now:
- Create an image and make it a child of the text
- On the text component click Advanced tab and set created image to the Extents Target field
- Set Image Stretch mode to Stretch and alpha to 0 (so it's invisible )
Now image will always fit to the text rectangle and you can use this image as a MeshVisual of the Touch component or in the Behavior script.
Best
Olha
Comment actions -
Thanks, Olha!
I tried and it works. Only issue though is that its limited to the area of the text rectangle that has text in it. So if my text rectangle is bigger than the text itself then the image won’t extent to the full width of my text object thus making it a not so useful solution in practice.
Thanks
Comment actions
Please sign in to leave a comment.
Have a comment?