You are not logged in.

1

Wednesday, April 4th 2012, 8:20pm

[SOLVED] Display FOV and TILT in separate textfield with custom CSS

Hi,
me again with a new fix needed ;-)

so i want OnScreen information like FOV and TILT,
with my code i can display FOV and TILT in the same textbox, but for design reasons, i need to separate them to position where i want onScreen,

so basically , i 've 2 actions with 2 events and 2 textstyle

Source code

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
<textstyle name="FOVTEXT" origin="bottom" edge="bottom"  yoffset="-135" textalign="center" background="false" border="false" fontsize="12" textcolor="0x666666" bold="false" 
	effect="glow(0xFFFFFF,0.0,0,0);glow(0x000000,0,0,0);dropshadow(0,0,0x000000,0,0.0);" showtime="2.0" fadetime="1.0" />
	
	<textstyle name="TILTTEXT" origin="bottom" edge="bottom"  yoffset="-165" textalign="center" background="false" border="false" fontsize="12" textcolor="0x666666" bold="false" 
	effect="glow(0xFFFFFF,0.0,0,0);glow(0x000000,0,0,0);dropshadow(0,0,0x000000,0,0.0);" showtime="2.0" fadetime="1.0" />
	
	<action name="show_fov_text">
      copy(fov,view.fov);
      roundval(fov,2);
      <!-- copy(tilt,view.vlookat); -->
	  <!-- roundval(tilt,2); -->
      txtadd(msg,'ANGLE OF VIEW = ',get(fov),'°');
       <!-- txtadd(msg,'ANGLE OF VIEW = ',get(fov),'°  TILT = ',get(tilt),'°'); -->
      showtext(get(msg),FOVTEXT);
   </action>
   
   <action name="show_tilt_text">
	copy(tilt,view.vlookat);
	roundval(tilt,2);
	txtadd(msg,'TILT = ',get(tilt),'°');
	showtext(get(msg),TILTTEXT);
	</action>

	<events name="fovdisplay" keep="true" onviewchanged="show_fov_text();" />
	<events name="tiltdisplay" keep="true" onviewchanged="show_tilt_text();" /> 


i 've got hard time to figure out where my mistake is...

Thanks for pointing out for the fix

z

This post has been edited 1 times, last edit by "zadda" (Apr 12th 2012, 10:06am)


2

Wednesday, April 4th 2012, 9:26pm

Hi,

there can be only one showtext text at the same time on the screen,
that means when calling showtext again the previous showtext will be removed,

if you only want a vertical offset between the texts try using [br] for line breaks,
alternatively you could try using the textfield plugin to show the texts constantly on two different places,

best regards,
Klaus

3

Thursday, April 5th 2012, 8:31pm

Quoted

there can be only one showtext text at the same time on the screen,
that means when calling showtext again the previous showtext will be removed,


a bit annoying *huh*

Quoted

alternatively you could try using the textfield plugin to show the texts constantly on two different places

ya, but is it html5 compatible ?

Thanks

z

4

Friday, April 6th 2012, 10:39am

Hi,
ya, but is it html5 compatible ?
yes, much more then the showtext action which is Flash-only at the moment

best regards,
Klaus

5

Friday, April 6th 2012, 11:35am

ok,

question now is how to populate my textfield with my Tilt value ?

Source code

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
<plugin name="htmltext" url="textfield.swf" 
        origin="topright" parent="stage"
        width="100" height="30" 
        x="34" y="500" 
        html="data:htmldata1"
        css="data:cssdata1"
        borderwidth="0"
        bordercolor="0xFFFFFF"
        background="false"
        backgroundcolor="0xFFFFFF"
        selectable="false"
        autosize="center"
        />
          
    <data name="htmldata1">
   <p align="center">
     
       <b>Tilt : </b>
     
   </p>
	</data>  

	<data name="cssdata1">
	p{color:#777777; font-family:Arial; font-size:12;}
   	a       { text-decoration:underline; font-weight:bold; }
   	a:hover { color:#885500; }
	</data> 
	
	<action name="show_tilt_text">
	copy(tilt,view.vlookat);
	roundval(tilt,2);
	txtadd(msg,'TILT = ',get(tilt),'°');
	showtext(get(msg),TILTTEXT);
	</action>


there event:ACTION in documentation, but i think case is different here...

Thanks

z

6

Monday, April 9th 2012, 4:29pm

Hi,

- still no figuring out How to display my Tilt value and FOV inside textfield ? *confused*
- How to display Tilt as Nadir is -90° (not +90°as it seems the case with krpano) ? *wacko*

Thanks

z

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

7

Monday, April 9th 2012, 7:23pm

You can multiply a positive number by -1 to get a negative number.
To set a plugin textfield's html use
set(plugin[textfield_plugin_name].html, get(view.vlookat));
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

8

Tuesday, April 10th 2012, 3:56pm

Thanks Sacha,

this is exactly what i was looking for *thumbsup*


But....
How to apply my text CSS (font color) and add "°" at the end ?

Source code

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<events name="fovdisplay" keep="true" onviewchanged="show_fov_text();" />

	<action name="show_fov_text">
      copy(fov,view.fov);
      roundval(fov,2);
      copy(tilt,view.vlookat);
	  roundval(tilt,2);
	  mul(tilt,-1);
      set(plugin[textfield_tilt].html, get(tilt));
      set(plugin[textfield_fov].html, get(fov));
   </action>

<!--  Textfield displaying TILT  -->	
	<plugin name="textfield_tilt" url="textfield.swf" 
        origin="topright" parent="stage" width="100" height="30" x="134" y="780" 
        html="data:htmldata1"
        css="data:cssdata1" 
        borderwidth="0" bordercolor="0xFFFFFF"
        background="false"
        backgroundcolor="0xFFFFFF"
        selectable="false"
        autosize="center"
        />
          
    <data name="htmldata1">
   <p align="center">
       <b>Angle of view : </b>°
   </p>
	</data> 
	
	<!--  Textfield displaying FOV  -->
	<plugin name="textfield_fov" url="textfield.swf" 
        origin="topright" parent="stage" width="100" height="30" x="134" y="800" 
        html="data:htmldata2"
        css="data:cssdata1" 
        borderwidth="0" bordercolor="0xFFFFFF"
        background="false"
        backgroundcolor="0xFFFFFF"
        selectable="false"
        autosize="center"
        />
        
	<data name="htmldata2">
   <p align="center">
       <b>Tilt : </b>°
   </p>
	</data> 

	<data name="cssdata1">
	p{color:#666666; font-family:Arial; font-size:12;}
   	a       { text-decoration:underline; font-weight:bold; }
   	a:hover { color:#885500; }
	</data> 


Thanks

z

This post has been edited 1 times, last edit by "zadda" (Apr 10th 2012, 4:24pm)


9

Thursday, April 12th 2012, 8:29am

Hi,

just - keep it simple

there is no need for additional <data> elements,
build the text you want to show with the txtadd action and set it directly to the 'html' attribute of the textfield,
the css style can also be set directly to the 'css' attribute (but note - the latest krpano version need to be used for that)

e.g.

Source code

1
2
txtadd(plugin[textfield_tilt].html, '[b]Tilt :[/b] ', get(tilt), '°');
txtadd(plugin[textfield_fov].html, '[b]Angle of view :[/b] ', get(fov), '°');


and

Source code

1
2
<plugin name="textfield_fov" ... css="color:#666666; font-family:Arial; font-size:12;" />
<plugin name="textfield_tilt" ... css="color:#666666; font-family:Arial; font-size:12;" />


btw - in your textfield plugin elements replace the - origin="topright" - with - align="topright" - 'origin' is officially not supported anymore, it was renamed to 'align'.

best regards,
Klaus

10

Thursday, April 12th 2012, 10:05am

Hi Klaus,

so easy with you,
Thanks *thumbsup*

great support !


z