You are not logged in.

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

1

Thursday, December 28th 2017, 4:51pm

How to trace the clicked object? [solved by Umalo]

Hi, please I need help with this idea:



For testing project I want to get the name of any clicked object (layer/hotspot) in the stage. I thought in a code as: to click any object, open console, show it name...

<events on onmouseup="showlog();trace('the clicked object is ",get(name));/>

The above code isnot correct because the get is for previous coded object, but it is only for give idea...

Maybe to put dinamically a code to all object with for set(i,0), i LT layer.count.... trace(get(name)).... then after when is clicked show the name y remove dinamically this code to original state....

Any idea?

Best Regards,

Fernando

This post has been edited 2 times, last edit by "publicitarios360" (Dec 31st 2017, 3:19am)


Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

2

Saturday, December 30th 2017, 12:50am

I could propose to display names on hover and some switch (in my case combo at top) when you want to have names displayed or normal layer/hotspot onhovers. Something like this: Link

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

3

Saturday, December 30th 2017, 9:09pm

Thanks Umalo, the solution for me looks like your example. Hover instead click is perfect and the combobox for switching is ok too.

In the example, the layer with hotspot/layer name flicks. First it is visible but it turns to no visible in very few time. But the idea was shown.

In order to avoid conflict with previous hover property of the objects (hotspot/layer), this property should be overwritten temporaly (while the combobox state is turned off)

If you could share the code of your example, so i can try it directly on my projects as an aid to coding i'd be very grateful.

Thanks for your answer.

Fernando.

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

4

Saturday, December 30th 2017, 9:47pm

Instead of showtext you can make your own text layer and display hovered layer/hotspot name there. Code is open for your adaptation. You can see it here
See how I escaped combobox layers not to trriger showtext.

publicitarios360

Intermediate

  • "publicitarios360" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

5

Sunday, December 31st 2017, 3:18am

[solved by Umalo]

Hi Umalo, thanks very much for sharing the code. and your fast and precise answer. Works perfect!!! *thumbsup*

Note for other users: The code as it is works for krpano 1.19 pr 14 (not pr 13 or older) due to the new if / ifnot structure


Very grateful,

Fernando