Floorplan from different years and link to buttons

Q&A about the latest versions
Post Reply
abgestumpft
Posts: 15
Joined: Sat May 28, 2011 11:47 am

Hi,

I'm currently creating a virtual tour of a house from different years. Therefore I have created a floorplan for each year (from same file).
Under the map I have two white buttons (made of Textboxes elements) were the year can be selected, like "2013" and "2021".
Now I want the Button (=Textbox) to do two thing:
1. Change the floorplan to the year shown on the button (this is working)
2. Depending on what floorplan is shown (which year), the corresponding Button should be highlighted (=different background): partly working

What I did now:
1. Created a global variable: map_year (number) = 2013
2. On the Button/Text box properties I have created two actions (example for 2013 button):
a) Mouse Click -> Change Map -> Floorplan_2013
b) Mouse Click -> Set Variable Value -> Set(=)/ 2013 -> map_year
3. On the Button/Text box properties -> Rectangle -> Background Color I created one logic block:
a) map_year = 2013 -> Background Color = blue

The floorplan and color of button is changing as expected when using the buttons.
But: when I'm e.g. in the 2013 floorplan/tour and I press the 2021 floorplan button the floorplan changes to 2021 and the 2021 button is highlighted (as expected). Then clicking on a hotspot in the Panorama (still year 2013 shown in the tour) the floorplan changes back to 2013 (using simple floorplan with auto switch floor plan) - which is also OK, but the button of 2021 is still highlighted (because variable map_year is not changed back to 2013 in that scenario).

Is there a way to link the active floorplan to a variable?
Any other solution for the problem?

thanks and kind regards
Sebastian
abgestumpft
Posts: 15
Joined: Sat May 28, 2011 11:47 am

Hi,
I managed to solve it with a workaround:
1. I changed the global variable from number to text: map_year (text) = 2013
2. On each Panorama from 2013 I entered in User Data -> Information: "2013" and for year 2021 I entered "2021"
3. In Skin Editor, I added a new action: Node Changed -> Set Variable -> Set(=) / $ui - map_year. This means that everytime a panorama is loaded, the global variable map_year will be set to $ui = User Data -> Information of the panorama, that contains the year of the panorama
4. For the Buttons, I still have the action (example for 2013 button):
a) Mouse Click -> Change Map -> Floorplan_2013
b) Mouse Click -> Set Variable Value -> Set(=)/ 2013 -> map_year
5. On the Button/Text box properties -> Rectangle -> Background Color I created one logic block:
a) map_year = 2013 -> Background Color = blue (for the 2013 button)
b) map_year = 2021 -> Background Color = blue (for the 2021 button)
Post Reply