• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Text moving after modifying field[livename].text

Mathias

Moderator
Staff member
For my skills with domains, I'm adding a script to modify field[livename].text once the domain is entered. What's weird is that the name portal repositions itself after this happens. I have an explicit field[name].left = 0 line in the position script. The name portal always shifts right (unless a very long domain is entered, and the text is cut off) - it's as if the text went from being left-aligned to right-aligned within the name portal.

What am I missing?
 
I have no idea what's going wrong. Please email me or Colen the data files and we can take a look to see what's gone sideways.
 
After taking a look at the data files you sent, the problem is the combination of positioning logic and style used on the portal. The "name" portal is using the "lblNormal" style. If you take a look at this style in "styles_ui.aug", you'll see that it specifies "align=center". This will center the text horizontally within the width of the portal. You are calculating the width of the portal to use a fixed span that is much wider than the actual text being displayed within the portal. This results in the name of the skill being centered within the span you specified for the portal.

The solution is to do one of two things. Option #1 is to change to the "lblLeft" style, which will cause the text in the portal to always be left-aligned instead of centered. Option #2 is to use the same basic logic that you chose not to use when the "domain" is present and that was previously used in the Position script. The original code set the width of the name portal to be the smaller of the name width or the space available. This results in the name always being left-aligned within the portal, since the portal is always the size of the name text or smaller.
 
Back
Top