You are not logged in.

Artur

Beginner

  • "Artur" started this thread

Posts: 7

Location: Portugal

Occupation: Student

  • Send private message

1

Wednesday, April 15th 2020, 11:28am

Addhotspot - Style

Hi!
Anyone knows if i can do this?
give a style and a name to a hotspot[newspot] ?
Because i want to create more then 1 hotspot, i try to create an increment action but it doesn't work...


addhotspot(newspot);
set(hotspot[newspot].url,'%SWFPATH%/skin/proximo.png');
set(hotspot[newspot].scale, 0.1);
set(hotspot[newspot].zoom,true);
set(hotspot[newspot].visible, true);
set(hotspot[newspot].dragable, true);

set(hotspot[newspot].style, abc );
set(hotspot[newspot].name, def );


Thanks! *smile*

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Wednesday, April 15th 2020, 11:32am

Hi,

Try:
hotspot[newspot].loadstyle(style-name);

https://krpano.com/docu/xml/#hotspot.loadstyle

Use a 'for' loop to create multiple hotspots. Use the 'i' to create unique name and then assign/addhotspot.

On phone now,
I'll extend later.


Hope it helps,
Tuur *thumbsup*

Artur

Beginner

  • "Artur" started this thread

Posts: 7

Location: Portugal

Occupation: Student

  • Send private message

3

Wednesday, April 15th 2020, 11:49am

Thanks Tuur!
i will try *thumbsup*

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Wednesday, April 15th 2020, 11:55am

Hi,

here a simple example:

Source code

1
2
3
4
5
6
7
8
9
10
11
    <style name="htsp" type="text" width="10" height="10" atv="0" bgcolor="0xff0000" />
    
    <action name="createhtsp">
        for(set(i,0), i LT 10, inc(i),
            calc(_newhtsp, 'spot_' + i);
            addhotspot(get(_newhtsp));
            copy(_nh, hotspot[get(_newhtsp)]);
            _nh.loadstyle(htsp);
            calc(_nh.ath, i * 10);
        );
    </action>


this will give you 10 hotspots at atv 0 with style htsp..
ath = i * 10 .. so 0*10 , 1*10, 2*10 etc..

don't forget to 'call' the 'createhtsp' action.

https://krpano.com/docu/actions/#for

Hope it helps
Tuur *thumbsup*

Artur

Beginner

  • "Artur" started this thread

Posts: 7

Location: Portugal

Occupation: Student

  • Send private message

5

Wednesday, April 15th 2020, 4:30pm

Thank you very much Tuur,
this is working perfectly! It is not exactly what I need to do but from this I think I can get there!



Thanks!


Artur *thumbsup*

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

6

Wednesday, April 15th 2020, 5:09pm

Cheers!
Of course it is just a tech example code.. it will be impossible to be exact because we don't know what you exactly want.

Tuur *thumbsup*