Sie sind nicht angemeldet.

1

Donnerstag, 29. März 2018, 12:03

Height of dynamic layer

Hi there,

is it possible to get the height of a layer, that has no height set specifically?

For example I have a layer like this:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<layer
name="contactinfo"
type="text"
align="leftbottom"
x="20"
y="20"
html="Some Content Text[br /]Even More Content Text"
css="color:#fff;font-size:14px;"
vcenter="true"
padding="12"
bg="false"
bgcolor="0x000000"
bgalpha="0.25"
bgborder="3 0xFFFFFF 0.5"
bgroundedge="5"
mergedalpha="true"
keep="true"
zorder="3"
width="200"
onloaded="copy(abc_height, layer[contactinfo].pixelheight); trace('Contact Height ', get(abc_height));"
/>


My onloaded code always returns 0. When a height is set it returns the set height but not dynamically.
Is there a way to achieve this?

Best Regards
Richard

toosten

Fortgeschrittener

Beiträge: 521

Wohnort: Berlin

Beruf: Software-Entwickler bei VR-Easy ( HTML, JS, PHP, krpano, C++, Java )

  • Nachricht senden

2

Donnerstag, 29. März 2018, 12:31

https://krpano.com/plugins/textfield/#onautosized

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<layer
name="contactinfo"
type="text"
align="leftbottom"
x="20"
y="20"
html="Some Content Text[br /]Even More Content Text"
css="color:#fff;font-size:14px;"
vcenter="true"
padding="12"
bg="false"
bgcolor="0x000000"
bgalpha="0.25"
bgborder="3 0xFFFFFF 0.5"
bgroundedge="5"
mergedalpha="true"
keep="true"
zorder="3"
width="200"
onautosized="copy(abc_height, layer[contactinfo].height); trace('Contact Height ', get(abc_height));"
/>

3

Donnerstag, 29. März 2018, 13:14

Thank you very much!

I have totally overlooked this *pinch*