Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Dienstag, 2. Oktober 2018, 19:26

stage.mouse.x not getting the right value

hello,
i'm a beginer at krpano and i have a cylinder pano image and i'm trying to make an if sentence

Quellcode

1
if(		mouse.stagex LT 1000 	,			if( 				mouse.stagex GT 1500 	, 					rightside();					, 					middleside();			);			, 			leftside();	);

but i don't get x of the whole image (for example if i click on left side of the screen even though i'm on the right side of pano image it says it's lower) any tip would be much appreciated or correction if i'm doing this completely wrong

thank you and best regards
tom

2

Mittwoch, 3. Oktober 2018, 04:51

What event do you put this action on? *question*

3

Mittwoch, 3. Oktober 2018, 10:45

on view change

i made an event on view change to check where mouse.stagex was clicked. Am i doing it wrong?

4

Mittwoch, 3. Oktober 2018, 13:27

When you change the view or click of the mouse?
On click:

Quellcode

1
2
3
<events  onclick="if(mouse.stagex LT 1000,if(mouse.stagex GT 1500,rightside();,middleside();),leftside(););"
    
        />

5

Mittwoch, 3. Oktober 2018, 16:35

but the problem still persist that when i click on the left side of the screen it thinks we are lt then 1000 even though i'm on the right side of the pano image :/

Beiträge: 731

Wohnort: Sevastopol, Crimea, Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

6

Mittwoch, 3. Oktober 2018, 16:45

Hi)

Try this one:

Quellcode

1
<action name="check_screen_pos" scope="local" >		div(screen_section, stagewidth, 3);				if(mouse.stagex LE screen_section, trace(left));				if(mouse.stagex GE calc(stagewidth - screen_section), trace(right));				if(mouse.stagex GT screen_section AND mouse.stagex LT calc(stagewidth - screen_section), trace(middle));	</action>



Note that "screen_section" variable needs to be updated when the screen resizes
Regards,

Alexey

7

Mittwoch, 3. Oktober 2018, 16:45

You have a contradiction in the code.

If "x" mice are less than 1000, then execute - if "x" mice are more than 1500 .... this condition will never be fulfilled.

8

Donnerstag, 4. Oktober 2018, 09:31

Hi,

first - you shouldn't use absolute values when checking for sizes, not everyone is using the same browser window size ;-)

Here an example code for testing if the click is in the left, the middle or the right third of the screen:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<events onclick="test();" />

<action name="test">
    if(mouse.stagex LT stagewidth*1/3,
        trace(left side);
    , mouse.stagex GT stagewidth*2/3,
        trace(right side);
    ,
        trace(middle);
    );
</action>



Best regards,
Klaus

9

Freitag, 5. Oktober 2018, 13:00

Thank you all for your answers!

is there a way to do this function but instead of checking in which area of screen was clicked, but for a whole pano? i thought that stage.x check on the whole image not just screen

best regards
tom

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ploteus« (8. Oktober 2018, 18:56) aus folgendem Grund: rephrasing the question


10

Mittwoch, 17. Oktober 2018, 12:26

Sorry for bumping in this thread but i've tried so many options and i'm lost. Is there any way to get mouse position on screen regarding whole size of pano image?

best regards and thank you for your answers
tom

Beiträge: 731

Wohnort: Sevastopol, Crimea, Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

11

Mittwoch, 17. Oktober 2018, 14:05

Hi)

what exactly do you want to implement? There's 'spheretoscreen' option, but it will calculate panorama coordinates into screen coordinates only for the pano section currently inside the vieving area (Klaus explained this somewhere on the forum and even provided a simple illuastation of this principle).
Regards,

Alexey

12

Mittwoch, 17. Oktober 2018, 14:22

well i'm trying to implement minimap on a pano image and my thinking was that i could move mimimap overlay depending which area of whole image is clicked. so if i was on the left side of the screen i would have overlay on left etc

hmm i guess i need to go back to drawing board :)
thank you for your answer!
best regards

Beiträge: 731

Wohnort: Sevastopol, Crimea, Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

13

Mittwoch, 17. Oktober 2018, 14:47

Regards,

Alexey

14

Mittwoch, 17. Oktober 2018, 14:55

o wow ok haven't seen that thread thank you will try it, you think this might work for flat pano image (gigapixel)?