Starfinder Playlist
  1. #1

    Anchoring issue/bug

    I have two controls set up like this:

    Code:
    <genericcontrol name="columnanchor">
    	<!-- <anchored height="0">
    		<top offset="40" />
    		<left offset="30" />
    		<right offset="-30" />
    	</anchored> -->
    	<anchored position="insidetop" offset="-30,40" />
    	<disabled />
    	<invisible />
    </genericcontrol>
    
    <stringcontrol name="instructions_label">
    	<font>sheetlabel</font>
    	<nodrag />
    	<readonly />
    	<anchored height="40">
    		<top parent="columnanchor" anchor="bottom" relation="relative" offset="7" />
    		<left parent="columnanchor" anchor="left" />
    		<right anchor="right" />
    	</anchored>
    	<multilinespacing>20</multilinespacing>
    	<static textres="pc_label_parse_instructions" />
    </stringcontrol>
    If I change the <right> anchor of "instructions_label" to <right parent="columnanchor" anchor="right" /> then the control disappears. I've tried this with both of the anchoring schemes in columnanchor and see the same behavior. I simply want the stringcontrol to be anchored to the left and right extents of the columnanchor control. What am I missing/doing wrong?

    Obviously I could just directly set the offset= on the <right> element to a static value, which seems to work fine. I'm just wondering why the approach above isn't working. I feel like I'm missing something obvious.
    Last edited by darrenan; March 22nd, 2023 at 18:25.

  2. #2

  3. #3
    It's because your columnanchor does not have a width. In the other examples in the built-in rulesets, the column anchor is usually tied to an offset from the left/right edges of the parent window, which gives it an implied dynamic width based on the size of the window.

    In your example above, your columnanchor has a top/left anchor, but no right/bottom anchors, nor width/height specifiers. This means that it will default to zero height/width.

    Regards,
    JPG

  4. #4
    I thought "insidetop" had implied left and right anchors? That's what the anchors diagram seems to suggest. And yes, I should have put height 0 on that version of the anchor.

    Also, the commented-out version did have all those anchors and I was seeing the same issue.
    Last edited by darrenan; March 27th, 2023 at 16:01.

  5. #5
    "below" would put it off the bottom of the window since it's not attached to a control, but the containing window. I believe insidetop is the appropriate anchor based on the diagram.

  6. #6
    Ok, the actual problem was that I had <invisible/> on columnanchor. I guess you can't anchor to invisible controls. Once I removed that it started working just fine.

  7. #7
    Invisible eliminates it as an anchoring target.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Idea Informer

  8. #8
    You are correct on the "insidetop", so sorry for the red herring. Controls must be visible to be anchored to, as you've found.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in