STAR TREK 2d20
Page 1 of 3 123 Last
  1. #1

    Anchoring width problem

    I'm too tired to continue for tonight, but I seem to have run into a problem:
    I have a frame, and I want a description underneath that frame, in the "below" anchoring position.
    ...and I can set that up like this:
    Code:
    	<template name="charattribute_description">
    		<stringcontrol>
    			<anchored position="below" width="57" /><!-- Width is being ignored for some reason. -->
    			<font>sheetlabelmini</font>
    			<center />
    			<nodrag />
    			<readonly />
    		</stringcontrol>
    	</template>
    	
    	<charattribute_description>
    			<anchored to="willpowerframe" />
    			<!-- <anchored>
    				<top parent="willpowerframe" anchor="bottom" />
    			</anchored> -->
    			<static textres="char_desc_attr_willpower1" />
    	</charattribute_description>
    However, for longer texts, the text will not go beyond the edges of the above frame, and I can't seem to change that width. Instead the text will get pushed to the left, and get cut off to the right of it.

    As you can see, I've tried another method too, that I've commented out, but with that method I can define no horizontal anchor, since the text needs to be centered.

    ...so I'm going to bed now and hope that you can solve this little puzzle in 8 hours or so.

  2. #2
    The "below" position sets the top, left and right anchors; which is why your width is being ignored (i.e. left and right anchors are already set).

    Regards,
    JPG

  3. #3
    "below" uses the same width as the object you're anchoring to. If you want to have a width different than your "below" parent you need to use something like "bottomleft" or "insidebottomleft" and adjust alignment.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  4. #4
    Also, "belowleft", "belowright", ...

    JPG

  5. #5
    Yes, but I want the description CENTERED underneath the frame, and an " anchor="center" " center-to-center anchor doesn't seem to exist.

    For example, this doesn't work:
    Code:
    	<template name="charattribute_description">
    		<stringcontrol>
    			Debug.console()
    			<anchored width="57">
    				<top anchor="bottom" />
    				<center relation="relative" anchor="center" />
    			</anchored>
    			<font>sheetlabelmini</font>
    			<center />
    			<nodrag />
    			<readonly />
    		</stringcontrol>
    	</template>
    
    
    	<charattribute_description>
    		<anchored to="willpowerframe">
    			<top parent="willpowerframe" />
    			<center parent="willpowerframe" />
    		</anchored>
    		<static textres="char_desc_attr_willpower1" />
    	</charattribute_description>
    Do I really need to use scripting here in this case? ...and some post layout "width/2" offset?

  6. #6
    There is no "center" anchor. There is only left/top/right/bottom anchors.

    Why not try:
    Code:
    	<template name="charattribute_description">
    		<stringcontrol>
    			<anchored position="below" />
    			<font>sheetlabelmini</font>
    			<center />
    			<nodrag />
    			<readonly />
    		</stringcontrol>
    	</template>
    Regards,
    JPG

  7. #7
    Quote Originally Posted by Moon Wizard View Post
    There is no "center" anchor. There is only left/top/right/bottom anchors.

    Why not try:
    Code:
    	<template name="charattribute_description">
    		<stringcontrol>
    			<anchored position="below" />
    			<font>sheetlabelmini</font>
    			<center />
    			<nodrag />
    			<readonly />
    		</stringcontrol>
    	</template>
    Regards,
    JPG
    Because, as I said in my first post, the frame is too small to fit the text.
    Maybe an ASCII illustration will help.
    OOOO = The frame
    Willpower = The text
    Code:
    What I want:
    
    ..OOOO...
    Willpower
    
    
    What I get with <anchored position="below" />:
    
    ..OOOO...
    ..Will...
    Last edited by MooCow; January 8th, 2020 at 21:21. Reason: Corrected the illustration.

  8. #8
    ...and the console repeats this:
    "Ruleset Warning: window: Anchored static width ignored for control () in windowclass (charsheet_front)
    Ruleset Warning: window: Anchored static width ignored for control (attributeslabel) in windowclass (charsheet_front)"

  9. #9
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,674
    Blog Entries
    1
    Quote Originally Posted by MooCow View Post
    Because, as I said in my first post, the frame is too small to fit the text.
    As Moon Wizard said in the second post the anchoring you are using also inherits the left and right boundaries/anchors.

    Increase the size of the frame.

  10. #10
    Quote Originally Posted by celestian View Post
    "below" uses the same width as the object you're anchoring to. If you want to have a width different than your "below" parent you need to use something like "bottomleft" or "insidebottomleft" and adjust alignment.
    Quote Originally Posted by MooCow View Post
    ...and the console repeats this:
    "Ruleset Warning: window: Anchored static width ignored for control () in windowclass (charsheet_front)
    Ruleset Warning: window: Anchored static width ignored for control (attributeslabel) in windowclass (charsheet_front)"
    See my comment.... and JPGs.

    If you want to alter the width of the thing you're anchoring to it you need to stop using bottom.

    Use bottomleft, insidebottomleft, belowleft or belowright.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

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