You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, September 30th 2009, 4:41am

Trying to find quick way to place 30 plugins

Hi,

I have 30 plugins (small red ball) that appear over the top of a floor plan of a building (which is a plugin itself). I can get the plugins to appear no problem and when I mouse over each one the relevant name comes up in a small balloon window. Clicking on them loads the the correct panorama into the viewer.

Problem is it's taking me forever to position these damn red balls in the correct position by adjusting the X and Y values. It truly an awful job and I have another plan next week with 35 plugins to go on it *pinch*

I had a look and found the post at the following url

http://krpano.com/forum/wbb/index.php?page=Thread&threadID=193

but don't understand how to get it up and running. I have the downloaded files in the plugins folder and added <plugin url="plugins/jsmouse.swf" /> to the xml file. Not sure where to put the code below?

Source code

1
2
3
var krpano = document.getElementById("krpanoSWFObject");
var mousex  = krpano.get("mouse.x");
var mousey  = krpano.get("mouse.y");


I do hope someone has already found a quick way to get the mouse pistion to place plugings cos i'm going to be lucky to make it to saturday at this rate *wacko*

Many thanks,

Andrew

2

Wednesday, September 30th 2009, 5:03am

This may not be what you are looking for but I love it for placing hotspots.

hotspots

the fourth post contains a cursorposition.zip file. Add it in like a plugin and it tells you both x and y. And also ath and atv. I believe I got those letters right.

Jarredja

This post has been edited 1 times, last edit by "Jarredja" (Sep 30th 2009, 5:20am)


3

Wednesday, September 30th 2009, 5:38am

Jarredja, many thanks for the quick reply. I've downloaded and added the plugin.

It certainly does seem to be the sort of thing that would help me but with this one example the coordinates that the mouse cursor position shows is X = 110 and Y = 119 and doesn't seem to match the actual location of the red ball (plugin) which uses the following code in the xml sheet to place it.

Source code

1
2
3
4
		align="center"
		edge="lefttop"
		x="-230"
		y="20"


I suspect it's got something to do with the edge="lefttop part but am unsure what to change lefttop to to start using the exact mouse cursor position figures.

There does seem to be hope on the horizon though *g*

Andrew

4

Wednesday, September 30th 2009, 5:51am

I would guess

edge="center" although since it is an "edge" that probably doesn't make sense. You say this is your hotspot cordinates? Try rotating only to the right and you should get only positive points, I believe.
I am on an iphone right now so I can't refer to my files.

5

Wednesday, September 30th 2009, 6:37am

Ahhhh *smile* I seem to be getting some results.

If I set it to

align="lefttop"
edge="lefttop"


then I can use the mouse cursor position figures to position the plugin with the X and Y values in the xml file. I thought it was going well but then switched to full screen mode and the plugins all shifted. Returning to normal size and all is back in place.

There's no rotation of the panorama needed as the plugins are red ball markers that are positioned on top of a floor plan. The actual floorplan can be made visible in the center of the viewer by clicking on the button and then click it again to remove it.

I'd rather spend my time trying to work out this mouse cursor position plugin now than spend hours shifting X and Y values up and down.

Thanks again,

Andrew

6

Wednesday, September 30th 2009, 6:45am

Just a thought, does your hotspot seem to float away from the pano? Are you using zoom="true" ?

7

Wednesday, September 30th 2009, 6:56am

Are you using the ath and atv for the hotspot point?

8

Wednesday, September 30th 2009, 6:58am

yes, it shoots out towards the top left side of the viewer when it goes to full screen (24 inch monitor) and the floor plan stays where it should in the middle of the viewer. I have tried using keep="true" and also after you mentioned it zoom="true" but no getting it to stay put.

It's very odd, if i set the plugin to the original values i started with

align="center"
edge="lefttop"
x="-230"
y="20"


then it's in the correct postion on floor plan and stays in the same position even when switched to full screen mode. Problem is all this minus numbers scenario just put's me back to doing everything manually and that's just plain evil ;-)

9

Wednesday, September 30th 2009, 7:31am

Here is a basic hotspot I use. Maybe it will help you. I don't use x and y instead I use the ath and atv

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<hotspot name="hotspot1" url="ball.swf" ath="-87" atv="4" 
			  scale="0.5" zoom="true" onhover="showtext(show text here,bold);" 
			 keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         alpha="1.00" blendmode="normal"
 	         smoothing="true"
 	         onloaded="resetsize();"
			 onout="" 
			  
			  
	
	onclick="looktohotspot(hotspot1);
         loadpano(pano.xml, null, MERGE, BLEND(1));
		 lookat(-170,0,10);
		 zoomto(90,smooth(720,50,360));"
/>


And I always turn to the right to ensure positive numbers.

10

Wednesday, September 30th 2009, 4:04pm

Thanks for your further help Jarredja. I'll give your code a try later this morning. Just woke up here on the west coast of Canada *sleeping*

I did stay away from the ath= and atv= as i thought they were for positions within the 360 degree panorama itself and that the X and Y was for a position on the actual flash viewer? My floor plan never changes position as it is always loaded into the middle of the screen when the button is clicked and is not linked to any of the panoramas that are loaded below it. The plugin coordinates would have to be 'screen' related. Thats my theory anyway.

No matter I will give the code a shot and see what it brings.

All the best,

Andrew

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

11

Wednesday, September 30th 2009, 4:45pm

Hi,

It seems there is some misunderstanding on your discussion:

Quoted

I have 30 plugins (small red ball)
Your are talking about to get coordinates of plugins and Jarredja ;-) are talking about to get coordinates of hotspots... *rolleyes*
This is not the same... such as you point above:

Quoted

I did stay away from the ath= and atv= as i thought they were for positions within the 360 degree panorama itself and that the X and Y was for a position on the actual flash viewer?
Hotspot coordinates are relative to the full 360 pano and plugins coordinates are relative to the Krpano display screen.
Look at the documentation about <plugin>. You will find a picture that explain really well "Illustration of the relation of "align", "edge", "x", "y", "width", "height" and scale:"

About the cursorposition.zip plugin, I have not tried it (I will do *smile* ). But, if I am not on mistake, the x y coordinates it gives are relative to the topleft of the screen... And you are looking to retrieve coordinates relative to center of the screen... *sad*

If I see a way to do, I will tell you. ;-)

Salut.

12

Wednesday, September 30th 2009, 6:23pm

Good eye Michel. Your attention to detail is amazing. I was referring to hotspots the entire time. Sorry Andrew if I led you astray.

13

Wednesday, September 30th 2009, 6:38pm

Hi Michel,

Yes, Jarredja had been kindly helping me out but as you said we seem to have got our wires crossed with the plugins and hotspots. I tried the code but it is in relation to the actual panorama and not the viewer itself. Thanks anyway Jarredj, but at least I know how to place hotspots in the future which is bound to happen soon.

I tell you what, last night i got to the point where i couldn't manually adjust another plugin via the X & Y and that was when i gave up for a while and started reading this forum for an alternative solution.

Here's a screen shot which may explain things better




Thanks,

Andrew

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

14

Wednesday, September 30th 2009, 6:42pm

Hi jarredja,

Mistake is human *smile* ;-) ....

I will try to use the cursorposition.zip plugin...
  • I am thinking in using the plugin that correspond to andrew22222 floor plan aligned to lefttop...
  • Then, get some x y coordinates with the cursorposition plugin (those coordinates will be relative to the floor plan plugin lefttop)...
  • And then make the small red ball plugins childs of the floor plan (the parent) and aligned to leftop of the parent...
In a few minutes I going to try ... My first try about child and parent too....
I will tell you. ;-) (I go out for some minutes)

Salut.

This post has been edited 1 times, last edit by "michel" (Sep 30th 2009, 8:56pm)


15

Wednesday, September 30th 2009, 9:01pm

Excellent Michel. Thanks.

I've no idea what you just said with childs and parents as it's getting a little over my head knowledge wise but looking forward to learning something new *thumbsup*

Andrew

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

16

Wednesday, September 30th 2009, 9:22pm

Hi andrew22222,

The cursorposition.swf plugin give X Y coordinates relative to topleft.. then your floor plan must be in the same reference alignment.
I thing this code can be the base code to do:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<krpano version="1.0.8">

	<!-- use only a grid preview pano to save download space ;-) -->
	<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />

	<!-- floor plan - aligned lefttop to get correct X Y  -->
	<plugin name="floor_plan" url="your_floor_plan_image.png"
		align="lefttop" edge="lefttop"
		handcursor="false" capture="false"
		/>

	<!-- cursorposition plugin - one aligned leftbottom of the floor plan, the other one aligned righttop -->
	<plugin name="cur_pos_leftbottom" url="%SWFPATH%/plugins/cursorposition.swf"
		parent="floor_plan" align="leftbottom" edge="lefttop"
		zorder="1" blendmode="difference"
		/>
	<plugin name="cur_pos_righttop" url="%SWFPATH%/plugins/cursorposition.swf"
		parent="floor_plan" align="righttop" edge="lefttop"
		zorder="1" blendmode="difference"
		/>

	<!-- the childs, list of small red ball you need -->
	<!-- X value from the cursorposision plugin -->
	<!-- Y value from the cursorposision plugin -->
	<plugin name="red_ball_1" url="your_red_ball_image.png" zorder="99"
		parent="floor_plan"
		align="lefttop"
		edge="center"
		x="70"
		y="60"
		/>
	<plugin name="red_ball_2" url="your_red_ball_image.png" zorder="99"
		parent="floor_plan"
		align="lefttop"
		edge="center"
		x="168"
		y="168"
		/>

</krpano>


When you get all your red_ball, you will align your floor plan centred.
Hope this is what you was looking for.

Salut.

Edited: corrected after the advise from jarredja below. *thumbup*

This post has been edited 4 times, last edit by "michel" (Sep 30th 2009, 10:32pm)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

17

Wednesday, September 30th 2009, 9:25pm

Hi,

Quoted

I've no idea what you just said with childs and parents........
parent/child system:
  • parent attribute for all plugins/hotspots
  • usage:
    • parent="pluginname" or parent="plugin[pluginname]" or parent="hotspot[hotspotname]"
  • the aligment of a child refers then to the parent
  • can be changed dynamically
  • "scalechildren" attribute - to scale also child plugins on parent scaling, default="false"
Salut

18

Wednesday, September 30th 2009, 10:08pm

great job, Michel.

I did find that the parent tags didn't work though. Either the parent plugin should be renamed map or the parent tags should be made to match name of the plugin

Quoted

<plugin name="floor plan"


either way, you still turned out a good piece of code to solve the problem. *thumbsup* I tested to ensure that the movement between normal view and fullscreen was fixed and your fix does it. At least with my plugin.swf file.

I realize I have never done something like this so thank you for the lesson.

I only use a few plugins and I placed them the old fashion way, Place and correct.

Jarredja

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

19

Wednesday, September 30th 2009, 10:17pm

Hi jarredja,

Quoted

I did find that the parent tags didn't work though. Either the parent plugin should be renamed map or the parent tags should be made to match name of the plugin
Your are absolutly right... *g* *rolleyes* It was my mistake when copy past my code an rectifying it to adapt to andrew22222 ..

I go to edit it... Thank you. *thumbsup* *thumbup*

20

Wednesday, September 30th 2009, 10:42pm

OMG.... that works so well. Thanks for that. This evening when I start adding the red ball markers my brain may not resemble mash potato like it did last night when I finally called it quits and went to bed.

Yes, I simply changed the name to 'map' and all worked great. I also have the balloon markers to add as plugins on top of the red balls so this will make it all so much easier. The balloon markers with text appear when you mouse over it's red ball marker. I added the same code (also with parent="map") and that too stays in the same position when going full screen.

Many thanks to you both for taking an interest. If you both have a paypal account pm me the address and I'll put some cash in for a case of beer..... or a bottle of vodka *w00t*

Still a lot of work to but at least all the coding is nailed now and it's interesting learning all this as I go along.

Thanks to the creator of the cursorposition plugin also.

All the best

Andrew