#1
|
|||
|
|||
Custom-permanent tooltip
I am trying to create a permanent tooltip using panels, but cannot make it work as desired. I basically want the panel/tooltip to be linked to an object (node) on screen, using normalized window coordinates. The problems are:
1. Using tooltips I get limited functionality/appearance and cannot seem to be able to translate to window coordinates (0-1). I couldn't find a way to convert the normalized coordinates in a window to pixels in the window (not world). 2. Using vizdlg panels I can format the panel as desired, but cannot link it to the object (a shape primitive). The offset does not work as expected although the object is added as a parent to the screen (not the world). Additionally, the panel does not follow the movement of the object, as would be expected from the linking. I attach a script with my experiments. Both approaches can be seen and tested. Help would be greatly appreciated! |
#2
|
|||
|
|||
The panel is added to the ortho layer so it is positioned in pixel coordinates. The shape is added to the screen and uses normalized screen coordinates. Linking the two will not work. You could get the window size and calculate the pixel coordinates to place the panel at:
Code:
windowSize = viz.window.getSize() shapePos = self.s.getPosition() self.panelLink = viz.link(viz.LeftBottom,self.tipTab) self.panelLink.setOffset([windowSize[0]*shapePos[0],windowSize[1]*shapePos[1],0]) |
#3
|
|||
|
|||
OK, that does the trick, indeed. Thanks!
Just to verify. There is no simpler way (e.g. a command) that translates the screen normalized coordinates to window (ortho) pixel coordinates? |
Tags |
links, normalizedtopixels, tooltips |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding custom faces | mjabon | Vizard | 2 | 04-01-2009 08:34 PM |
How do I add custom functions to a custom plugin? | reedev | Plug-in development | 7 | 02-01-2009 03:39 AM |
Custom Drop-Down Menus and Sliders | south_bank | Vizard | 2 | 05-20-2008 04:27 AM |
animating custom faces: in search of "open_mouth" morphs | vr_boyko | Vizard | 1 | 09-16-2004 10:30 AM |
Creating Custom Avatar Heads | farshizzo | Vizard | 22 | 09-12-2004 09:23 PM |