You are not logged in.

1

Sunday, September 19th 2010, 9:17pm

Using Include to add Buttons - Newbie/Non-Programmer

Hello,

Have trouble with something probably pretty basic. I've looked at the examples and it's great to show what each component does but what the examples don't show is how to combine them. For instance I have managed to get working individually the scene combobox and the buttons but cannot get them working together.

I have tried two xml files using the swf.addVariables. I guess simply cutting and pasting is not the right solution so here is my code. Any help would be greatly appreciated. Also is there any place on the site that can explain the basics of using the proper syntax in the appropriate place?

Quoted

<krpano version="1.0.8" onstart="action(start)">

<preview type="CUBESTRIP" url="lobby.tiles/preview.jpg" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="lobby.tiles/pano_l_%0v%0h.jpg" />
<front url="lobby.tiles/pano_f_%0v%0h.jpg" />
<right url="lobby.tiles/pano_r_%0v%0h.jpg" />
<back url="lobby.tiles/pano_b_%0v%0h.jpg" />
<up url="lobby.tiles/pano_u_%0v%0h.jpg" />
<down url="lobby.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


<!-- text style for startup info -->
<textstyle name="infostyle" origin="top" edge="top" yoffset="20" textalign="center" background="false" border="false" fontsize="40" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="1.0" fadetime="1.0" />



<!-- combobox plugin -->
<plugin name="box" url="plugins/combobox.swf" preload="true"
keep="true"
align="lefttop" x="10" y="10" width="150"
blendmode="layer"
/>


<action name="start">
plugin[box].addIdItem(1, 'Lobby', loadscene(lobby, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(2, 'Room 1', loadscene(room1, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(3, 'Room 2', loadscene(room2, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(4, 'Room 3', loadscene(room3, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(5, 'Room 4', loadscene(room4, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(6, 'Room 5', loadscene(room5, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(7, 'Room 6', loadscene(room6, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(8, 'Room 7', loadscene(room7, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(9, 'Playground - Covered', loadscene(play1, null, MERGE, BLEND(1)); );
plugin[box].addIdItem(10, 'Playground - Open', loadscene(play2, null, MERGE, BLEND(1)); );


<!-- load 1. scene on start -->
loadscene(Lobby, null, MERGE);
</action>

<!-- scenes -->


<!-- first scene/pano-->
<scene name="Lobby" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(1);
</action>

<view hlookat="30" vlookat="0" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="lobby.tiles/pano_l_%0v%0h.jpg" />
<front url="lobby.tiles/pano_f_%0v%0h.jpg" />
<right url="lobby.tiles/pano_r_%0v%0h.jpg" />
<back url="lobby.tiles/pano_b_%0v%0h.jpg" />
<up url="lobby.tiles/pano_u_%0v%0h.jpg" />
<down url="lobby.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


<!-- place here scene local elements like plugins,hotspots, ... -->

</scene>

<!-- place here scene local elements like plugins,hotspots, ... -->

<!-- second scene/pano-->
<scene name="Room1" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(2);
</action>

<view hlookat="20" vlookat="0" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room1.tiles/pano_l_%0v%0h.jpg" />
<front url="room1.tiles/pano_f_%0v%0h.jpg" />
<right url="room1.tiles/pano_r_%0v%0h.jpg" />
<back url="room1.tiles/pano_b_%0v%0h.jpg" />
<up url="room1.tiles/pano_u_%0v%0h.jpg" />
<down url="room1.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>

<!-- place here scene local elements like plugins,hotspots, ... -->


</scene>



<!-- third scene/pano-->
<scene name="Room2" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(3);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room2.tiles/pano_l_%0v%0h.jpg" />
<front url="room2.tiles/pano_f_%0v%0h.jpg" />
<right url="room2.tiles/pano_r_%0v%0h.jpg" />
<back url="room2.tiles/pano_b_%0v%0h.jpg" />
<up url="room2.tiles/pano_u_%0v%0h.jpg" />
<down url="room2.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>

<!-- place here scene local elements like plugins,hotspots, ... -->

</scene>

<!-- fourth scene/pano-->
<scene name="Room3" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(4);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room3.tiles/pano_l_%0v%0h.jpg" />
<front url="room3.tiles/pano_f_%0v%0h.jpg" />
<right url="room3.tiles/pano_r_%0v%0h.jpg" />
<back url="room3.tiles/pano_b_%0v%0h.jpg" />
<up url="room3.tiles/pano_u_%0v%0h.jpg" />
<down url="room3.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>

</scene>

<!-- fifth scene/pano-->
<scene name="Room4" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(5);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room4.tiles/pano_l_%0v%0h.jpg" />
<front url="room4.tiles/pano_f_%0v%0h.jpg" />
<right url="room4.tiles/pano_r_%0v%0h.jpg" />
<back url="room4.tiles/pano_b_%0v%0h.jpg" />
<up url="room4.tiles/pano_u_%0v%0h.jpg" />
<down url="room4.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


</scene>

<!-- sixth scene/pano-->
<scene name="Room5" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(6);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room5.tiles/pano_l_%0v%0h.jpg" />
<front url="room5.tiles/pano_f_%0v%0h.jpg" />
<right url="room5.tiles/pano_r_%0v%0h.jpg" />
<back url="room5.tiles/pano_b_%0v%0h.jpg" />
<up url="room5.tiles/pano_u_%0v%0h.jpg" />
<down url="room5.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


</scene>

<!-- seventh scene/pano-->
<scene name="Room6" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(7);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room6.tiles/pano_l_%0v%0h.jpg" />
<front url="room6.tiles/pano_f_%0v%0h.jpg" />
<right url="room6.tiles/pano_r_%0v%0h.jpg" />
<back url="room6.tiles/pano_b_%0v%0h.jpg" />
<up url="room6.tiles/pano_u_%0v%0h.jpg" />
<down url="room6.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


</scene>

<!-- eighth scene/pano-->
<scene name="Room7" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(8);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="room7.tiles/pano_l_%0v%0h.jpg" />
<front url="room7.tiles/pano_f_%0v%0h.jpg" />
<right url="room7.tiles/pano_r_%0v%0h.jpg" />
<back url="room7.tiles/pano_b_%0v%0h.jpg" />
<up url="room7.tiles/pano_u_%0v%0h.jpg" />
<down url="room7.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


</scene>

<!-- ninth scene/pano-->
<scene name="Play1" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(9);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="play1.tiles/pano_l_%0v%0h.jpg" />
<front url="play1.tiles/pano_f_%0v%0h.jpg" />
<right url="play1.tiles/pano_r_%0v%0h.jpg" />
<back url="play1.tiles/pano_b_%0v%0h.jpg" />
<up url="play1.tiles/pano_u_%0v%0h.jpg" />
<down url="play1.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>


</scene>

<!-- tenth scene/pano-->
<scene name="Play2" onstart="action(startscene);">

<action name="startscene">
plugin[box].selectIdItem(10);
</action>

<view hlookat="-110" vlookat="8" fov="100" />

<image type="CUBE" multires="true" tilesize="4000">
<level tiledimagewidth="2200" tiledimageheight="2200">
<left url="play2.tiles/pano_l_%0v%0h.jpg" />
<front url="play2.tiles/pano_f_%0v%0h.jpg" />
<right url="play2.tiles/pano_r_%0v%0h.jpg" />
<back url="play2.tiles/pano_b_%0v%0h.jpg" />
<up url="play2.tiles/pano_u_%0v%0h.jpg" />
<down url="play2.tiles/pano_d_%0v%0h.jpg" />
</level>
</image>

</scene>

<!-- include buttons template (based on the buttons.png image)-->
<include url="buttons-png-include.xml" />

<!-- here a other template (based on the buttons.jpg image)
<include url="buttons-jpg-include.xml" />
-->

<!-- view settings -->
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" fovmin="60" fovmax="120" />

</krpano>

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Sunday, September 19th 2010, 9:56pm

Hi rbudnikas,

<include>
have a look to the buttons example that comes inside the krpano downloaded file...

Source code

1
2
	<!-- include buttons template (based on the buttons.png image)-->
	<include url="buttons-png-include.xml" />


SAlut.

3

Sunday, September 19th 2010, 10:43pm

Have you looked at the log to see if maybe a path to the xml is incorrect or if the path to the image is incorrect? It seems you have the include tag correct as long as the paths are correct too.

You say were able to get it working without the combobox? Did you use the same folder to do both tests?

Edit: Press O for the log.

4

Monday, September 20th 2010, 12:16am

All it shows me is the licensing so I'm not sure what the issue is. Also yes,, I was working in the same directory.

5

Monday, September 20th 2010, 4:01pm

Hi,

when using scenes (or several panos) be sure that all buttons have set - keep="true",
otherwise they will be removed on loading the scene or the next scene/pano,

best regards,
Klaus

6

Monday, September 20th 2010, 4:16pm

Hi Klaus,

I got it working and I'm moving along. Obviously a little bit of a learning curve for me but I like it so far. please bare with me as I'm not a programmer and could use all the help I can get. As I mentioned I've been using pano2vr and really want to move away from it. Also don't want to have to create my panos in it and then convert as I learn krpano.

I've been adding other elements and get it to about 80% and then can't figure the rest out.

Thanks for your support.

Robert

Similar threads