|
|
Quellcode |
1 2 3 4 5 6 |
<plugin name="left" url="../images/whitemask.png" keep="true" visible="true" alpha="0" handcursor="false" zorder="98" align="left" width="10%" height="100%" onover="tween(plugin[left].alpha, 0.1);set(movevectorx,-0.2);" onout="tween(plugin[left].alpha,0);set(movevectorx,0);" /> <plugin name="right" url="../images/whitemask.png" keep="true" visible="true" alpha="0" handcursor="false" zorder="98" align="right" width="10%" height="100%" onover="tween(plugin[right].alpha, 0.1); set(movevectorx,+0.2); "onout="tween(plugin[right].alpha, 0);set(movevectorx,0);" /> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 |
<plugin name="topleft" url="../images/whitemask.png"
keep="true"
visible="true"
alpha="0"
handcursor="false"
zorder="98"
align="left"
width="10%"
height="100%"
onover="tween(plugin[left].alpha, 0.1);set(movevectorx,-0.7);set(movevectorx,0.7);"
onout="tween(plugin[left].alpha,0);set(movevectorx,0);"
/>
|
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comHi,It's possible with the followmouse plugin, but the plugin reacts as soon as you leave the center. I want it to react as soon its 90% of the center (near the edge). So I was thinking about enabling/disabling the mousefollow plugin as it reaches the border or something...
|
|
Quellcode |
1 2 |
var sx:Number = stage.stageWidth * 0.5; var sy:Number = stage.stageHeight * 0.5; |
the pixel size and position (from left top) from the area can be readed via these variables:To area? iow krpano.get(area.width) ?
|
|
Quellcode |
1 2 3 4 |
var mx:Number = stage.mouseX - krpano.get("area.pixelx");
var my:Number = stage.mouseY - krpano.get("area.pixely");
var sx:Number = krpano.get("area.pixelwidth") * 0.5;
var sy:Number = krpano.get("area.pixelheight") * 0.5;
|
|
|
Quellcode |
1 2 |
vx = (vx < 0 ? -1.0 : +1.0) * Math.pow(Math.abs(vx), 2.0);
vy = (vy < 0 ? -1.0 : +1.0) * Math.pow(Math.abs(vy), 2.0);
|
|
|
Quellcode |
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 |
private function mouse_move (event:MouseEvent):void
{
var mx:Number = stage.mouseX - krpano.get("area.pixelx");
var my:Number = stage.mouseY - krpano.get("area.pixely");
var sx:Number = (krpano.get("area.pixelwidth") - 250) * 0.5;
var sy:Number = krpano.get("area.pixelheight") * 0.5;
// calc motion vectors: -1.0 to +1.0
var vx:Number = (mx - sx) / sx;
var vy:Number = (my - sy) / sy;
//if mouse button is down or mouse is in the center, stop movement
if ( event.buttonDown || (vx > -0.5 && vx < 0.5 && vy > -0.5 && vy < 0.5) )
{
// middle area - normal control
krpano.set("hlookat_moveforce", 0);
krpano.set("vlookat_moveforce", 0);
}
else
{
// outer area - automatic followmouse movement. -1 to 1
vx = 2.0 * (vx < 0 ? -1.0 : +1.0) * (Math.max(Math.abs(vx),0.75) - 0.75);
vy = 2.0 * (vy < 0 ? -1.0 : +1.0) * (Math.max(Math.abs(vy),0.75) - 0.75);
// stop very slow moving
if (Math.abs(vx) < 0.01) vx = 0;
if (Math.abs(vy) < 0.01) vy = 0;
// stop moving when in black.
if (Math.abs(vx) > 1) {vx = 0; vy = 0;}
if (Math.abs(vy) > 1) vy = 0;
// set move forces
krpano.set("hlookat_moveforce", vx);
krpano.set("vlookat_moveforce", vy);
}
}
|
|
|
Quellcode |
1 2 3 |
// set move forces
krpano.set("hlookat_moveforce", vx * 0.5);
krpano.set("vlookat_moveforce", vy * 0.5);
|
originally the "hlookat_moveforce" and "vlookat_moveforce" variables were used only internally for keyboard control,
Zitat
Now there is only 1 thing I'm struggling with. It seems it ignores the mousespeed, mousefriction, mouseaccellerate settings