View Single Post
Old 12-01-2010, 12:52 PM
Salvar Salvar is offline
Join Date: Nov 2010
Posts: 20
Originally Posted by Jeff View Post
Each letter and the bounding box area around each letter can be picked. If you are outside that bounding box or between letters the pick won't register.

If you want to be able to pick in between letters you could create a quad, place it near the text, and hide it. Then you could check if that get's picked:
import viz
import vizact



text = viz.addText('Pick Me',pos = [-1.5,1.5,5])

size = text.getBoundingBox(viz.REL_LOCAL).size

quad = viz.addTexQuad(parent=text)

vizact.onpick(quad,viz.logNotice,'You picked the text')

Thanks for the reply.

I had that idea myself actually, but that created another problem. As clicking on the text object runs a function that parses the text, finds a URL, and loads it on the screen, I had the problem of referencing the parent text object when I click not the text object, but the quad "underneath".

Say in your example, how could you access the getMessage() method of the parent? I've tried a lot of things but I'm probably just missing the right one.
Reply With Quote