WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-07-2015, 04:46 PM
tokola tokola is offline
Member
 
Join Date: Nov 2012
Posts: 67
Red face 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!
Attached Files
File Type: zip tooltip.zip (1.1 KB, 837 views)
Reply With Quote
  #2  
Old 06-08-2015, 04:17 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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])
Reply With Quote
  #3  
Old 06-09-2015, 01:20 PM
tokola tokola is offline
Member
 
Join Date: Nov 2012
Posts: 67
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?
Reply With Quote
Reply

Tags
links, normalizedtopixels, tooltips

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 11:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC