Sie sind nicht angemeldet.

1

Mittwoch, 5. Dezember 2018, 18:10

Hotspot parent - Drag layer child

Hi there,

I've been trying to figure out a way to make a text container that is fixed to the panorama the same way a polygonal hotspot is. I've found some very promising instructions on the forums here.
With the code that I've got, is there a way to click and drag the text down within the hotspot to continue reading?

This is the parent hotspot, with a child layer:

Quellcode

1
2
<hotspot name="bubble2" scale="0.5" style="skin_base" crop="155|192|80|80" ath="-62.81" atv="-1.79" distorted="true" />
<layer name="bubble2_inner3" url="%SWFPATH%/plugins/textfield.swf"	parent="hotspot[bubble2]" align="lefttop" x="39" y="40" width="340%" height="195%" css="text-align:left; color:#000000; font-family:Arial; font-size:12px;" html="data:testtext" ondown="draglayer_vertically_within_parent();" />


This is the action for dragging a layer within a parent layer, and I'm wondering if I can make it work with a parent hotspot...

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<action name="draglayer_vertically_within_parent">
copy(drag_currenty, y);
copy(drag_stagey, mouse.stagey);
calc(y_min, layer[get(parent)].pixelheight - pixelheight);
if(y_min LT 0,
asyncloop(pressed,
calc(y, drag_currenty + (mouse.stagey - drag_stagey));
clamp(y, get(y_min), 0);
);
);
</action>


This is the entire text I want to be able to scroll through

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<data name="testtext">The krpano Viewer is a small and very flexible high-performance viewer for all kind of panoramic images and interactive virtual tours.
The viewer is available as Flash and HTML5 application.
The viewer is designed for the usage inside the Browser on Desktop (Windows, Mac, Linux) and on Mobiles/Tablets (iPhone, iPad, Android, ...).[br/]
[br/]
In addition to the krpano Viewer there are the krpano Tools - this are small tools and droplets
which are helping to automatically prepare the panoramic images for viewing and making them ready-to-use.
Making a pano or a tour is possible just by drag-and-drop.[br/]
[br/]
Convince yourself by viewing the examples and / or by downloading the krpano Viewer and krpano Tools for free and try using
them with your own panoramic images.[br/]
</data>



Thank you for any insight you might have!

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »mander« (5. Dezember 2018, 20:56)


2

Mittwoch, 5. Dezember 2018, 20:55

I actually got something pretty workable:


Quellcode

1
2
3
4
5
6
7
<hotspot name="bubble2" scale="0.5" style="skin_base_2" crop="155|192|80|80" ath="-62.81" atv="-1.79" distorted="true" />
<layer name="bubble2_inner3" url="%SWFPATH%/plugins/textfield.swf"	parent="hotspot[bubble2]" align="lefttop" x="39" y="40" width="340%" height="195%" bgcolor="0X333333" bgalpha="1.0" bgcapture="true" >
<layer name="title" parent="layer[bubble2_inner3]" style="text" align="top" y="2.5" width="100%" css="text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:10px;" html="Textbox" />
<layer name="textarea" parent="layer[bubble2_inner3]" type="container" align="top" x="0" y="20" width="250" height="130" maskchildren="true" >
<layer name="text" parent="layer[textarea]" style="text" enabled="true" align="lefttop" x="0" y="0" width="100%" autoheight="true" css="text-align:left; color:#FFFFFF; font-family:Arial; font-size:10px;" html="data:testtext" ondown="draglayer_vertically_within_parent();" />
</layer>
</layer>



Using this code gets me very close to what I want to be seeing. I just lose a lot of the text quality when maskchildren="true" is enabled.