Set textfield width using wordwrap: false /autosize:left

  • Hi all!

    Please take a look at my example:

    http://clients.tourvista.co.uk/vt/sir_jonathan_north/index.html

    According to the documentation, if I set 'wordwrap: false' and 'autosize:left' it should make the right side expands until it fits the entire text.
    As you can see it is not working. Am I missing something?

    My code is underneath.
    hotspot_bg is the school logo on the left side.
    hotspot is the problematic one.

    Thanks!!!!

    PS: tried 'autosize:right' and 'autosize:center' but doing that, the text flies from right to left when the tiles are loading and I never see it again *smile*
    Actually it is very funny so I am going to leave 'autosize:right' so you can see it, and post a screen shot using 'autosize:left'

  • I've tried to make it simpler to isolate the problem:

    Code
    addplugin(%1_hotspot);
        set(plugin[%1_hotspot].url,%HTMLPATH%/files/krpano/textfield.swf);
    	set(plugin[%1_hotspot].width,150);
    	set(plugin[%1_hotspot].height,20);
        set(plugin[%1_hotspot].html,Resistant materials);
    	set(plugin[%1_hotspot].align,center);
        set(plugin[%1_hotspot].background,true);
    	set(plugin[%1_hotspot].wordwrap,false);
    	set(plugin[%1_hotspot].autosize,center);

    Notice I have changed it from hotspot to plugin.

    This is the result:

    Background and text are split in two.

    set(plugin[%1_hotspot].autosize,right); places the text even further to the right.
    set(plugin[%1_hotspot].autosize,left); places the text inside the box, on the right side. But it doesn't resize the box width to adjust to the text.

    Just to clarify, what I would like to have is a box that adjust its width, so it doesn't matter the length of the text. Both, box and text will always fit each other. I thought that was the autosize functionality.

  • Hi Tourvista,

    Quote

    it doesn't resize the box width to adjust to the text

    Looking at the textfield doc it seems that autosize does not apply to the width... only to the height.

    • autosize
      fit height of textfield automatic to the content
      allowed values: "none", "left", "center", "right", default="none"

    Also, look at this thread from Graydon: textfield - autosize attribute explanation

    The textfield plugin is a little bit difficult to understand *g* ... At least for me *wink* ...

    SAlut.

  • Thanks for the reply Mishel,

    That thread is the only one talking about the wordwrap property. Every time I read it I understand a different thing *smile*
    Anyway I gave up. Now I am using a combination of two textfield plugins, one hosting the graphic and the other one hosting the text. And then replace them using ox and oy.

    Cheers

  • left,right, center is the text alignment when using wordwrap. One interesting feature is that if you have wordwrap false and autosize center or right. The text in the textfield gets really offended if you resize the window and starts making a run for it, even escaping all textfield attributes.

    Hi Tourvista,

    Looking at the textfield doc it seems that autosize does not apply to the width... only to the height.

    Also, look at this thread from Graydon: textfield - autosize attribute explanation

    The textfield plugin is a little bit difficult to understand *g* ... At least for me *wink* ...

    SAlut.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!