You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, May 27th 2021, 8:09pm

set maxheight dynamically for text layer maxing out at 300

Hello! I have a text layer that I'm creating dynamically. The layer's style has a maxheight of 200 which is respected but for certain types of text layers I would like to set the maxheight to 80% of the device height. When I try to do this dynamically, the max height I get is 300 not 900 in my case. How is it possible to change the maxheight to 900? I've also tried to set the maxheight in the style to 900 but the max it will go to is also 300. Am I missing something?


Source code

1
 <style type="text" name="textbox_style"  align="lefttop"    x="40"    y="0"    autowidth="false"    autoheight="true"    maxheight="900"    bgborder="0"    bgcolor="0x000000"    bgalpha=".75"    bgcapture="true"    handcursor="false"    alpha="0"    zorder="13"    interactivecontent="true"    visible="false"  />


and here's the function:

Source code

1
2
<!-- set up textboxes -->  <action name="setup_textbox" scope="local" args="hotspotname, parenttype">    <!-- assign layername -->    if (get(parenttype) == 'l',      txtadd(layername, 'tombstone_', get(hotspotname));    ,      txtadd(layername, get(hotspotname));    );
    if (layer[get(layername)].visible == true,      <!-- no need to create a new text box if it's already there -->    ,      <!-- remove all text boxes and create a new one -->      removeall_textboxes();      <!-- add text box with style -->      addlayer(get(layername));      assignstyle(layer[get(layername)],'textbox_style');      <!-- add text content -->      set(textlayer, get(layername));      set(textcontent, get(data[get(textlayer)].content));      txtadd(layer[get(layername)].onloaded, 'add_html_text("', get(textcontent),'")');            <!-- set up text box parent, width, placement -->      if(stagewidth LT 500,         set(layer[get(layername)].parent, );        set(layer[get(layername)].width, calc(stagewidth));        set(layer[get(layername)].x, 0);      ,         if (get(parenttype) == 'h',          txtadd(layer[get(layername)].parent, 'hotspot[', get(layername), ']');          change_align(get(layername));                    ,          txtreplace(tombstone_parent, layername, 'tombstone_', 'infoicon_');          txtadd(layer[get(layername)].parent, 'layer[', get(tombstone_parent), ']');          set(layer[get(layername)].maxheight, 900);                  );        set(layer[get(layername)].width, 400);        set(layer[get(layername)].x, 40);      );    );    <!-- show layer -->    tween_layer(get(layername));  </action>