Add your own code for hotspot or button action.  

Got some great idea or a feature request? Post it here and discuss it.
no avatar
aircamera
Member
 
Posts: 94
Joined: Sat Jul 21, 2012 1:00 pm

Add your own code for hotspot or button action.

by aircamera » Sat Jul 05, 2014 2:24 pm

Hi !
I've noticed that it's possible to call a javascript fonction, but I didn't find how to call just custom code strings. Or I don't understand how to use it ?

If not possible, this would be really great. So if we want a specific action, we don't need to edit xml file but we could enter it into PTP...
I hope you'll understand what I mean.
Thank you ! Cyril

User avatar
Destiny
Moderator
 
Posts: 5006
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Add your own code for hotspot or button action.

by Destiny » Sat Jul 05, 2014 11:52 pm

Hi..

You can use a CallToAction JS quite easily.. Just add your hot spot and then assigning a JS action.. In Styles its the last option, 'Advanced'. You will find lots about this here...
http://www.autopano.net/wiki-en/action/ ... umentation

Here is an example of using a CallToAction..
http://members.westnet.com.au/dps/js/Im ... lTest.html

Time is always an issue to experiment with this more... You can add an ID in your html to call in your media.. I am no expert but I do know there are many opportunities is using JS calls..

Destiny..

no avatar
aircamera
Member
 
Posts: 94
Joined: Sat Jul 21, 2012 1:00 pm

Re: Add your own code for hotspot or button action.

by aircamera » Sun Jul 06, 2014 10:26 am

Hi !
Thank you destiny for these explanations.
But what I have in my mind is easyer. You could enter in the box what you what to see into your xml file...
custom-code.jpg


If I try this at the moment with javascript call it look like this :
xml.jpg


What I need is the same without js(); I would like just my code... So then, if I want to update my tour, I don't need to to this work in xml files each time...

User avatar
Destiny
Moderator
 
Posts: 5006
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Add your own code for hotspot or button action.

by Destiny » Sun Jul 06, 2014 10:49 am

Hi..

Can't you do what you want by creating a custom xml file then add that to the User Directory so you can call it into PTP anytime.. You can also add it to your Plugin..

In the old days using PTP 1.8, to do any editing of the xml was painful since each time you rebut the Tour, you had to add the custom xml code again.. But all that changed with PTP V2+..

What features are you needing to update each time...

Destiny..

User avatar
bdd
Kolor Team
 
Posts: 1745
Joined: Tue Jan 18, 2011 4:05 pm

Re: Add your own code for hotspot or button action.

by bdd » Mon Jul 07, 2014 9:51 am

aircamera wrote:Hi !
Thank you destiny for these explanations.
But what I have in my mind is easyer. You could enter in the box what you what to see into your xml file...
The attachment custom-code.jpg is no longer available


If I try this at the moment with javascript call it look like this :
The attachment xml.jpg is no longer available


What I need is the same without js(); I would like just my code... So then, if I want to update my tour, I don't need to to this work in xml files each time...


Is the attached action what you want ?

In Panotour Pro, click on the "Open user directory" menu.
Copy the zip file there.
Unzip it here.
2 new files should appear in the "actions" subdirectory.

When you will restart PTP, a new Advanced action should appear.

customactions.zip
call custom krpano code
(699 Bytes) Downloaded 32 times


Gérald

no avatar
aircamera
Member
 
Posts: 94
Joined: Sat Jul 21, 2012 1:00 pm

Re: Add your own code for hotspot or button action.

by aircamera » Mon Jul 07, 2014 2:12 pm

Oh Gérald... ♥ I LOVE YOU once again ! ♥

I will save so much time :)

Destiny, I tried to make my own plugin... I can follow the tuto to do the red square, but I'm not familliar with this code. I miss informations to make it work. And I didn't find enough explainations...

Today, I need to create a button to to this action :

Code: Select all
for(set(i,0), i LT hotspot.count, inc(i),
            if(hotspot[get(i)].fillcolor == 0x0000ff,
           set(hotspot[get(i)].borderalpha, 1);
           set(hotspot[get(i)].fillalpha, 0.4);
           );
           );


With Gérald plugin I can paste it in the box and that's done ;-)

Thank you very much for your help and your support ! Good team !


Return to Panotour Future

Who is online

Users browsing this forum: No registered users and 1 guest