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

    https://krpano.com/forum/wbb/inde…threadID=193%20

    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?

    Code
    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

  • 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

    Edited once, last by Jarredja (September 30, 2009 at 5:20 AM).

  • 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.

    Code
    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

  • 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.

  • 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

  • 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 *wink*

  • 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

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

  • 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

  • Hi,

    It seems there is some misunderstanding on your discussion:

    Quote

    I have 30 plugins (small red ball)

    Your are talking about to get coordinates of plugins and Jarredja *wink* are talking about to get coordinates of hotspots... *rolleyes*
    This is not the same... such as you point above:

    Quote

    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. *wink*

    Salut.

  • 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

  • Hi jarredja,

    Mistake is human *smile* *wink* ....

    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. *wink* (I go out for some minutes)

    Salut.

    Edited once, last by michel (September 30, 2009 at 8:56 PM).

  • 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:

    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*

    Edited 4 times, last by michel (September 30, 2009 at 10:32 PM).

  • Hi,

    Quote

    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

  • 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

    Quote

    <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

  • Hi jarredja,

    Quote

    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*

  • 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

Participate now!

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