You are not logged in.

1

Thursday, March 29th 2018, 12:03pm

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:

Source code

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

Intermediate

Posts: 465

Location: Berlin

Occupation: freier Software-Entwickler ( HTML, JS, PHP, JSP, Flash, AS3, C++, Java, krpano, ---)

  • Send private message

2

Thursday, March 29th 2018, 12:31pm

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

Source code

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

Thursday, March 29th 2018, 1:14pm

Thank you very much!

I have totally overlooked this *pinch*