Jump to content

[SOLVED] engine.visualizer.getMessageExtent()


photo

Recommended Posts

Problem

 

We are using engine.visualizer.renderMessage2D/3D() for rendering interactive object multi-line text annotations while the user moves the mouse cusor over objects. At the moment text output is always centered on the specified anchor point. This is too restrictive.

 

post-82-0-96935800-1359577133_thumb.jpg

 

Unfortunately there is no engine.visualizer method for calculation the screen size/extent of the output text message which could be used to calculate an appropriate text offset in screen coordinates so the text can be positioned left/right/top/bottom aligned (or whatever) in relation to the mouse screen position.

 

Proposal

 

Addition of a simple function engine.visualizer.getMessageExtent() so users can calculate text offsets.

Link to comment
  • 4 weeks later...

engine.visualizer.renderMessage() functions will receive an additional argument for text alignment:

 

vec3(0,0,0) - center

vec3(1,0,0) - right

vec3(-1,0,0) - left

vec3(0,1,0) - bottom

vec3(0,-1,0) - top

Link to comment
×
×
  • Create New...