How to save the last scene...Beginner/Game

  • Hello, I'm beginner and a new user with krpano.( and I dont't speak english very well.).

    I tried to find on the forum but it's not easy...Actually, I would like to edit a sort of little "game".

    I'm editing a tour with my drawings, it's ok but I 'm looking for a way to save the informations when I shut down the browser (lookat, last visit etc).

    Is it possible to find the informations of browser and copy / overwrite them in the tour.xml ( xml, script php or else)?

    Many thanks,

  • Hi Tuur,
    Thanks for your answer. And sorry. I'm late...I was working and trying to understand. Actually, I'm just at the begining *cry*
    Here is just a wrong draft, but I imagine something like this with a javascript fonction:

    [code]script or function savelookat(){
    var hlookatvalue = storage.getItem('hlookat');
    var vlookatvalue = storage.getItem('vlookat');
    var hlookatelement = document.getElementById('hlookat');
    var vlookatelement = document.getElementById('vlookat');......}[code]

    But after I don't see at all how to replace the values in the tour.xml (wich gives value to tour.html.) *confused*
    I will call the function with a script button in ../tour.html I think.

    Well, maybe nothing's right with it. Maybe you can help me with links or krpano examples to go further.

    Many Thanks
    ( I only used a bit PHP with html forms and tables to post my drawings and create my website )

    Just for you to imagine the project, here is an old vtour test I've done.

  • there are a lot of tuts about cookies and localstorage
    for example these ones

    you basically need to write/update the cookie in the onviewchange or maybe better the onidle event
    and on page load you need to read the cookie and set the view parameters

    var hlookatelement = document.getElementById('hlookat');

    there are no such elements. you would do

    krpano.set("view.hlookat", hlookat_from_cookie);

    you can examine the standard vtourskin.xml,
    search for "skin_deeplinking_update" and do it the same way

    here is a template

  • So, many thanks indexofrefraction. And sorry! All wrong!!
    so I erase my post... I just try to understand and I'll try post soon when I'll be a little bit further...

    Edited once, last by Erickh (December 2, 2022 at 10:10 AM).

  • Well, I come back but I'm nearly at the same point.
    I precise it's the very first time I try to use krpano with js and code
    and my aims is not to have a solution but understand.
    Indeed I allready imagine the mountains of possibilities it offers form many projects I have!

    I tried many things firstly to get hlookat and write it...
    The only thing I managed to do is inspired by this example and exploring the code:…ples/index.html
    -> When I copy all code and integrate my pano in my tour.html whith my own xml, all is ok.
    -> but when I insert the same fonctions in my pano in fullscreen, buttons doesn't do anything. I don't know why.

    Concerning the template and your indications, I can't go further without help.
    Do I have to copy it in vtourskin: onidle write parameters every 0.5 sec (automatic saves)
    or I've got to launch functions since html tour? in wich file do I have work?

    Well, I hope you explain me a bit more so I can go further.
    Thanks for your help,


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!