Hey Philip,

For this, I usually I sweep the the vertices in the text mesh and find min
and max values and with this get the boundaries for a box.
The box can be drawn in a new face:

var box:Face = new Face();
box.moveTo(topLeft.x, topLeft.y, 0);
box.lineTo(topRight.x, topRight.y, 0);
box.lineTo(bottomRight.x, bottomRight.y, 0);
box.lineTo(bottomLeft.x, bottomLeft.y, 0);
box.lineTo(topLeft.x, topLeft.y, 0);
box.material = someColorMaterialWithAlmostZeroAlpha;
textMesh.addFace(box);

Hence the box acts as a hit. Its not visible, but it captures mouse clicks
around the text. You can also use inflate() on the rectangle you calculate
for the text bounds if you want to make your hit bigger.

Reply via email to