#1
|
|||
|
|||
Drag and drop Panels
Hi Jeff,
I've created a few panels and would like to allow the user to relocate the panel using the mouse. Similar to moving a window. May I know how can I do that in vizard? Thanks. Eugene |
#2
|
|||
|
|||
Are you referring to a vizinfo panel? There is no built-in way to do this. I'm not sure if the viz.pick command will work with objects added to viz.ORTHO, like the panel. I'll check and update here if there is a way. It maybe necessary to calculate if a mouse click is within a panel's bounds. You could try the following:
1) Calculate the panel bounds using the node.getBoundingBox method. 2) Handle the mouse down event and determine if the mouse position is inside the panel bounds. 3) Enable an update function that sets the panel position every frame based on the mouse position. The panel position takes screen coordinates and you can get the mouse position in screen coordinates. 4) Disable the update function when the mouse up event occurs. |
#3
|
|||
|
|||
Hi Jeff,
I'm using the vizdlg.panel() and vizdlg.TabPanel(). Would it be different? Eugene |
#4
|
|||
|
|||
No, you would have to follow the same steps.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drag and drop | amith | Vizard | 1 | 01-04-2012 04:30 PM |
use wii to drag and drop objects in vizard | amith | Vizard | 0 | 12-29-2011 07:50 AM |