You are not logged in.

1

Thursday, February 16th 2023, 7:00pm

Hit and miss counter

how to make a hit and miss counter



like the example of San7 here:


https://novosibpano.ru/VT/naperst/


Thanks

San7

Professional

Posts: 626

Occupation: coding in krpano

  • Send private message

2

Friday, February 17th 2023, 5:57am

Hello!
It all depends on the specific task.
For example, when clicking on a layer

Source code

1
2
<layer name="test" type="text" html="click" onloaded="set(num, 0)"  
    onclick="inc(num); calc(html,'№ ' + num);"/>

3

Friday, February 17th 2023, 11:29am

Hello!
It all depends on the specific task.
For example, when clicking on a layer

Source code

1
2
<layer name="test" type="text" html="click" onloaded="set(num, 0)" 
    onclick="inc(num); calc(html,'№ ' + num);"/>
Thanks San7.
Best *thumbsup*

4

Wednesday, February 22nd 2023, 7:31pm

Hello!
It all depends on the specific task.
For example, when clicking on a layer

Source code

1
2
<layer name="test" type="text" html="click" onloaded="set(num, 0)" 
    onclick="inc(num); calc(html,'№ ' + num);"/>
Thanks San7.
Best *thumbsup*
This works great, but what I'm looking for is that when I click on certain hotspots, it shows how many misses in one layer and how many hits in another, like in your example.
Thanks *thumbsup*

San7

Professional

Posts: 626

Occupation: coding in krpano

  • Send private message

5

Thursday, February 23rd 2023, 6:01am

Hello, this is a simple example. In it, the "okey" variable is switched "true / false" and, depending on the check, is displayed in the appropriate layer

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<action name="start" autorun="onstart">
	set(okey, false);
	set(yes_ch, 0); 
	set(no_ch, 0);
</action>
	
<layer name="test" type="text" html="click" onclick="switch(okey); chek();"/>
	
<action name="chek" >  
	if(okey,
		inc(yes_ch);  
		calc(layer[yes_l].html, 'YES = ' + yes_ch);
		,
		inc(no_ch);  
		calc(layer[no_l].html, 'NO = ' + no_ch);
	);
</action>	
	
<layer name="yes_l" type="text" x="100" html="YES = 0" />
<layer name="no_l" type="text" x="200" html="NO = 0" />

*smile*

6

Thursday, February 23rd 2023, 9:46am

action name="start" autorun="onstart">
set(okey, false);
set(yes_ch, 0);
set(no_ch, 0);





if(okey,
inc(yes_ch);
calc(layer[yes_l].html, 'YES = ' + yes_ch);
,
inc(no_ch);
calc(layer[no_l].html, 'NO = ' + no_ch);
);
</action>


Thanks San7 *thumbsup* *thumbsup* *thumbsup*