Sie sind nicht angemeldet.

1

Donnerstag, 16. Februar 2023, 19:00

Hit and miss counter

how to make a hit and miss counter



like the example of San7 here:


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


Thanks

2

Freitag, 17. Februar 2023, 05:57

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

Quellcode

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

3

Freitag, 17. Februar 2023, 11:29

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

Quellcode

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

4

Mittwoch, 22. Februar 2023, 19:31

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

Quellcode

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*

5

Donnerstag, 23. Februar 2023, 06:01

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

Quellcode

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

Donnerstag, 23. Februar 2023, 09:46

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*