Hotspot tooltips in smart devices

  • Hi,
    In tour.xml I've set

    Code
    tooltips_hotspots="true"


    In desktop computers, mouse pointer over the hotspot displays the scene title.
    How can I set the titles be displayed fixed below the hotspot arrow no matter where the pointer is and also be displayed in smart devices?
    Thank you

  • Hi Marciano,

    What I do is set the tooltip's parent to the hotspot. The tooltip must also be a hotspot and you only need the one. Then when you mouse over or press down it loads the tooltip text into the tooltip hotspot and sets the tooltip's parent to that hotspot. Mouse out or onup from the hotspot makes the tooltip invisible, again. If you also want this to work in WebVR, where hotspots cannot have children, you set the tooltip hotspot to the same ath/atv of the hotspot and git the tooltip a sufficient oy (y offset) value.

  • Hi Scott,
    I don't understand what your suggestion.
    My testing tour.xml contains vtourskin.xml also very-small skin, startup action and scenes with some hotspots.
    From a smartphone I cannot see hotspot texts in any way.

    Is it possible to have hotspot title always displayed for all kind of devices like this?


    Thank you

  • OK. Short answer is "yes" but it will take some work.

    You have to modify how tooltips are handled in vtourskin.xml, mostly the skin_tooltips style. You need to add ondown.touch/onup.touch events that are similar to the onover.mouse/onout.mouse events to display the tooltip.

    BTW, you will want to increase the tooltip oy from -2 to -30 or so your finger doesn't cover the tooltip.

    You want to add a delayedcall timer to ondown that, after 0.2 seconds or so sets the onclick event to null. Otherwise when you lift up the onclick event will fire. Then your onup event should restore the onclick event to the hotspot or it won't fire when you do want to click it.

    Here is revised code in vtourskin.xml:

    And in the skin_tooltip layer change oy="-2" to oy.desktop="-10" oy.no-desktop="-40"

    I think that does it.

  • Thanks a lot Scott."touch" is the key for smart devices.

    The problem I see here is that tooltips text stays in a display fixed position, it doesn't stay tied up to the arrow when the finger drags the screen

    It would be desirable that it remains tied up above the arrow. If not possible, then hide it after finger drag is detected.
    Thank you again.
    M

  • Ah. Didn't notice that because in my modified skin I added capture="true" in the skin_hotspotstyle style. When someone presses on the hotspot they can't move the pano, which is my preference.

    If you want to move the pano while pressing the hotspot... OK. I have a solution in mind that will require a complete rewrite but may actually be more elegant. Will get that out perhaps tonight.

  • Hey M,

    So here is revised code that will keep the tooltip with the hotspot in touch situations:

    Or my preferred solution, only use the hotspot tooltip: If you plan to use tooltips with layer elements such as buttons the below method won't work. So the above method would be preferred.

    "Disadvantage" of the second method is that the tooltip won't move with the mouse (although that should be programmable). I don't see a problem with that so I don't plan to worry about it.

    I trust this works.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!