Tooltip plugin¶
If you have the VastPark Player installed, download the example IMML file below and open the demo in the VastPark Player.
Overview¶
Demonstrates usage of the tooltip plugin.
Instructions¶
Mouse over the transform gizmo's for a tooltip to appear. Click the gizmo to enter that transform mode.
- Click box 1 to activate move mode
- Click box 2 to activate rotate mode
- Click box 3 to activate scale mode
- Click and drag box 4 to transform according to the mode that was selected.
Note¶
The attached tooltip-plugin2.imml file is compatible with 1.5. Models which did not exist were simply removed and the primitives were adjusted to serve in their place. Works in a similar fashion to the first.
Walkthrough¶
The demo uses both the element transformer and the tooltip plugin; However, its main focus is the tooltip plugin.
1 if(obj.name == 'Transform-Gizmo-Move') then
2
3 -- ASSIGN THE TOOLTIP TO THE OBJECT VIA THE PLUGIN
4 tooltipid = tooltipplugin:add('Move Mode\r\nCurrently Enabled: '..convert:tostring(scene:get('movemode')), obj)
5 -- ASSIGN THE TOOLTIP ID TO THE TOOLTIPID OBJECT VARIABLE
6 -- THIS WILL BE USED LATER FOR REMOVING THE TOOLTIP
7 obj:set('tooltipid', tooltipid)
The comments explain alot about what is going on, but what is important here is the code on line 4. Where the content of the tooltip is assigned. Note the string accepts escape characters such as "\r\n"