Sie sind nicht angemeldet.

Tourvista

Fortgeschrittener

  • »Tourvista« ist der Autor dieses Themas

Beiträge: 260

Wohnort: Leicester UK

  • Nachricht senden

1

Samstag, 12. Dezember 2009, 14:00

Set textfield width using wordwrap: false /autosize:left

Hi all!

Please take a look at my example:

http://clients.tourvista.co.uk/vt/sir_jo…orth/index.html

According to the documentation, if I set 'wordwrap: false' and 'autosize:left' it should make the right side expands until it fits the entire text.
As you can see it is not working. Am I missing something?

My code is underneath.
hotspot_bg is the school logo on the left side.
hotspot is the problematic one.

Thanks!!!!

PS: tried 'autosize:right' and 'autosize:center' but doing that, the text flies from right to left when the tiles are loading and I never see it again :-)
Actually it is very funny so I am going to leave 'autosize:right' so you can see it, and post a screen shot using 'autosize:left'



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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<action name="set_hotspots">
		action(config_hotspots, hs_1, reception_area, Resistant materials, 335.8, 15.0, 331.7, 0.5);	
</action>	


<action name="config_hotspots">

addhotspot(%1_hotspot_bg);
    set(hotspot[%1_hotspot_bg].url,%HTMLPATH%/files/krpano/textfield.swf);
	set(hotspot[%1_hotspot_bg].edge,centerright);
	set(hotspot[%1_hotspot_bg].width,60);
	set(hotspot[%1_hotspot_bg].height,55);
	set(hotspot[%1_hotspot_bg].html,[img src="files/images/hs_logo.png" width="50" height="40"/]);
	set(hotspot[%1_hotspot_bg].background,false);
	set(hotspot[%1_hotspot_bg].ath,%4);
	set(hotspot[%1_hotspot_bg].atv,%5);
	set(hotspot[%1_hotspot_bg].zorder,5);
	set(hotspot[%1_hotspot_bg].alpha,0.8);
	set(hotspot[%1_hotspot_bg].onhover,showtext(Explore %3,hs_style););
    set(hotspot[%1_hotspot_bg].onclick,lookto(%6,%7,20,smooth(100,20,50)); 
									loadpano(%HTMLPATH%/files/panos/%2.xml,null,MERGE,BLEND(1));
									action(set_hotspots);
									);			
	
addhotspot(%1_hotspot);
    set(hotspot[%1_hotspot].url,%HTMLPATH%/files/krpano/textfield.swf);
	set(hotspot[%1_hotspot].edge,centerleft);
	set(hotspot[%1_hotspot].children,false);
	set(hotspot[%1_hotspot].width,80);
	set(hotspot[%1_hotspot].height,40);
    set(hotspot[%1_hotspot].html,[p]%3[/p]);
	set(hotspot[%1_hotspot].css,data:hotspot_css);
	set(hotspot[%1_hotspot].ath,%4);
	set(hotspot[%1_hotspot].atv,%5);
	set(hotspot[%1_hotspot].ox,10);
    set(hotspot[%1_hotspot].background,true);
	set(hotspot[%1_hotspot].backgroundcolor,0x002b50);
	set(hotspot[%1_hotspot].bordercolor,0xffffff);
	set(hotspot[%1_hotspot].roundedge,5);
	set(hotspot[%1_hotspot].borderwidth,1);
	set(hotspot[%1_hotspot].wordwrap,false);
	set(hotspot[%1_hotspot].autosize,right);
	set(hotspot[%1_hotspot].selectable,false);
	set(hotspot[%1_hotspot].handcursor,true);
	set(hotspot[%1_hotspot].alpha,0.8);
	set(hotspot[%1_hotspot].zorder,5);
	set(hotspot[%1_hotspot].keep,false);
    set(hotspot[%1_hotspot].onclick,lookto(%6,%7,20,smooth(100,20,50)); 
									loadpano(%HTMLPATH%/files/panos/%2.xml,null,MERGE,BLEND(1));
									action(set_hotspots);
									);	
	
</action>		

<textstyle name="hs_style"
			font="Arial"
			fontsize="12"
			bold="true"
			italic="true"
			background="true"
			backgroundcolor="0xd7e1e4"
			border="true"
			bordercolor="0x002b50" 
			textcolor="0x002b50"
			alpha="1"
			blendmode="mormal"
			effect="" 
			origin="cursor" 
			edge="bottom" 
			textalign="none" 
			xoffset="0" 
			yoffset="-3"
/>
	
<data name="hotspot_css">	
	p { color:#ffffff; 
	    font-family:Arial; 
		font-weight:bold; 
		font-size:12; 			  
		text-align:center;
		margin-left:0;
		margin-right:0;
		}	
</data>

Tourvista

Fortgeschrittener

  • »Tourvista« ist der Autor dieses Themas

Beiträge: 260

Wohnort: Leicester UK

  • Nachricht senden

2

Samstag, 12. Dezember 2009, 16:22

I've tried to make it simpler to isolate the problem:

Quellcode

1
2
3
4
5
6
7
8
9
addplugin(%1_hotspot);
    set(plugin[%1_hotspot].url,%HTMLPATH%/files/krpano/textfield.swf);
	set(plugin[%1_hotspot].width,150);
	set(plugin[%1_hotspot].height,20);
    set(plugin[%1_hotspot].html,Resistant materials);
	set(plugin[%1_hotspot].align,center);
    set(plugin[%1_hotspot].background,true);
	set(plugin[%1_hotspot].wordwrap,false);
	set(plugin[%1_hotspot].autosize,center);


Notice I have changed it from hotspot to plugin.

This is the result:



Background and text are split in two.

set(plugin[%1_hotspot].autosize,right); places the text even further to the right.
set(plugin[%1_hotspot].autosize,left); places the text inside the box, on the right side. But it doesn't resize the box width to adjust to the text.

Just to clarify, what I would like to have is a box that adjust its width, so it doesn't matter the length of the text. Both, box and text will always fit each other. I thought that was the autosize functionality.

3

Samstag, 12. Dezember 2009, 18:04

Hi Tourvista,

Zitat

it doesn't resize the box width to adjust to the text
Looking at the textfield doc it seems that autosize does not apply to the width... only to the height.
  • autosize
    fit height of textfield automatic to the content
    allowed values: "none", "left", "center", "right", default="none"
Also, look at this thread from Graydon: textfield - autosize attribute explanation

The textfield plugin is a little bit difficult to understand *g* ... At least for me ;-) ...

SAlut.

Tourvista

Fortgeschrittener

  • »Tourvista« ist der Autor dieses Themas

Beiträge: 260

Wohnort: Leicester UK

  • Nachricht senden

4

Montag, 14. Dezember 2009, 13:39

Thanks for the reply Mishel,

That thread is the only one talking about the wordwrap property. Every time I read it I understand a different thing :-)
Anyway I gave up. Now I am using a combination of two textfield plugins, one hosting the graphic and the other one hosting the text. And then replace them using ox and oy.

Cheers

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

5

Montag, 24. Oktober 2011, 19:27

left,right, center is the text alignment when using wordwrap. One interesting feature is that if you have wordwrap false and autosize center or right. The text in the textfield gets really offended if you resize the window and starts making a run for it, even escaping all textfield attributes.

Hi Tourvista,

Zitat

it doesn't resize the box width to adjust to the text
Looking at the textfield doc it seems that autosize does not apply to the width... only to the height.
  • autosize
    fit height of textfield automatic to the content
    allowed values: "none", "left", "center", "right", default="none"
Also, look at this thread from Graydon: textfield - autosize attribute explanation

The textfield plugin is a little bit difficult to understand *g* ... At least for me ;-) ...

SAlut.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Ähnliche Themen