Sie sind nicht angemeldet.

1

Dienstag, 19. November 2013, 14:34

SOLVED: "Scrolling textfield" again... Editing dimensions of textfield/sliders: which parameters to change?

Hello,

Maybe this is of general interest: I'm trying to adjust the parameters of the standard KRPano scrolling textfield, but I feel lost. My textfield shall have a higher "height" value, but the only part I seem able to edit according to my needs is the height of the slide area ["scrollbar"-layer], not the slider ["scrollslider"-layer] itself and its position. So which values to alter?

Any help appreciated very much...

Yours,
Michael

This is the original XML-part of it, for those who want to have a quick glance at it...

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
	<layer name="textbox" url="textfield.png" align="center" x="0" y="0" width="280" height="200">
		
		<layer name="textmask" type="container" align="lefttop" x="5" y="5" width="240" height="190" maskchildren="true">
			<layer name="text" url="%SWFPATH%/plugins/textfield.swf" handcursor="false" children="false" align="lefttop" x="10" y="10" width="220" autoheight="true" background="false" border="false" html="data:testtext" css="color:#000000; font-family:Arial; font-size:12;" />
		</layer>
		
		<layer name="scrollbar" type="container" bgcolor="0x000000" bgalpha="0.3" align="righttop" x="5" y="5" zorder="1" width="19" height="190" />
		
		<layer name="scrollup" url="dirbutton.png" align="righttop" x="24" y="5" zorder="2" rotate="-90" crop="0|0|19|19" onovercrop="0|19|19|19" ondowncrop="0|38|19|19"
		   	ondown="asyncloop(pressed, sub(ny,layer[text].y,10); add(ny,+8); sub(th,170,layer[text].pixelheight); if(ny GT 0, set(ny,0)); div(sy,ny,th); mul(sy,133); add(sy,24); copy(layer[scrollslider].y,sy); add(ny,10); copy(layer[text].y,ny); );"
		   	/>

		<layer name="scrolldown" url="dirbutton.png" align="rightbottom" x="24" y="5" zorder="2" rotate="+90" crop="0|0|19|19" onovercrop="0|19|19|19" ondowncrop="0|38|19|19"
		   	ondown="asyncloop(pressed, sub(ny,layer[text].y,10); add(ny,-8); sub(th,170,layer[text].pixelheight); if(ny LT th, copy(ny,th)); div(sy,ny,th); mul(sy,133); add(sy,24); copy(layer[scrollslider].y,sy); add(ny,10); copy(layer[text].y,ny); );"
		   	/>

		<layer name="scrollslider" url="sliderbutton.png" align="righttop" x="5" y="24" zorder="2" crop="0|0|19|19" onovercrop="0|19|19|19" ondowncrop="0|38|19|19" 
		   	ondown="copy(cy,y);copy(sy,mouse.stagey);dragging();" 
		   	dragging="if(pressed, sub(dy,mouse.stagey,sy); add(ny,cy,dy); if(ny LT 24, set(ny,24)); if(ny GT 157, set(ny,157)); copy(y,ny); sub(ty,ny,24); div(ty,133); sub(th,170,layer[text].pixelheight); mul(ty,th); add(ty,10); copy(layer[text].y,ty); delayedcall(0,dragging()); );"
		   	/>

	</layer>

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »mstoss« (20. November 2013, 11:49) aus folgendem Grund: solved problem


Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

2

Dienstag, 19. November 2013, 16:01

I've asked the same herre:

Updating "Scrolling Textfield" example

Scrolling text is a tough nut to crack inside xml...

Is you want to adjust height, then all height of all elements must be altered. Textbox's height is 200px, then we have a textmask with 190px and scrollbar with 190px. So increase all of these relatively.
If you wish to increase the height of the "scrollslider" then

a) make a corresponding image
b) adjust its crop to your needs (E.g. crop="0|0|24|24" instead of crop="0|0|19|19")
c) look into "dragging(); action. There's a maximum bottom y position for the slider:

Quellcode

1
if(ny GT 157, set(ny,157));
you should increase it also proportionally.

Hope this gives a bit of help.
Regards,

Alexey

3

Mittwoch, 20. November 2013, 11:48

Thank you Alexey,

I had been aware of your similar question, hence teh "again" ;-) However, I did understand that you were fighting with relative dimensions of your textfield.

Anyway, I kept on going trying to fiddle with the parameters and in the end I succeeded - I guess:


As you said, the general dimensions where easy enough to understand, but my concern was, where to change the limitations of the sliding areas. In the example above I just adjusted the height value by adding 200px and so I did with those other values.

Anyway - thanks again for helping thinking on this issue :-)

Michael

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »mstoss« (20. November 2013, 12:18)