View Single Post
07/01/21, 08:50 AM   #12
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
Originally Posted by Baertram View Post
From my understanding, if you want the ItemFlavor to be directly below the TraitTypeText.
I've added resizeToFitDescendants="true" to your TLC so it will change it's size depending on the text and other contents and also DimensionConstraints so the maximum size will not be above 300 width and 500 height (change the height to your maximal needs).

Code:
<GuiXml>
    <Controls>
        <TopLevelControl name="CraftyStockListTooltip" hidden="true" mouseEnabled="true" movable="false" clampedToScreen="true" resizeToFitDescendants="true">
            <!--Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="0" offsetY="0"/-->
            <Dimensions x="300" y="0" />
            <DimensionConstraints minX="300" minY="0" maxX="300" maxY="500" />
            <Controls>
                <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" />
                <Texture name="$(parent)ItemIcon" textureFile="" tier="HIGH">
					<Dimensions x="50" y="50"/>
					<Anchor point="CENTER" relativeTo="$(parent)" relativePoint="TOP" offsetY="-10" />
				</Texture>
                <Label name="$(parent)ItemLink" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="">
                    <Anchor point="TOP" relativeTo="$(parent)ItemIcon" relativePoint="BOTTOM" offsetX="0" offsetY="10"/>
                </Label>
				<Label name="$(parent)ItemType" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="">
                    <Anchor point="TOP" relativeTo="$(parent)ItemLink" relativePoint="BOTTOM" offsetX="0" offsetY="5"/>
                </Label>

                <Texture name="$(parent)Divider" textureFile="/esoui/art/miscellaneous/horizontaldivider.dds" tier="HIGH">
					<Dimensions x="300" y="4"/>
					<Anchor point="CENTER" relativeTo="$(parent)ItemType" relativePoint="BOTTOM" offsetY="10" />
				</Texture>

				<Label name="$(parent)TraitTypeText" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="TOP" text="">
                    <Anchor point="TOPLEFT" relativeTo="$(parent)Divider" relativePoint="TOPLEFT" offsetX="15" offsetY="10"/>
                </Label>

                <Label name="$(parent)ItemFlavor" font="ZoFontGameLargeBold" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="TOP" text="">
                    <Anchor point="TOPLEFT" relativeTo="$(parent)TraitTypeText" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="0"/>
                </Label>

            </Controls>
        </TopLevelControl>
    </Controls>
</GuiXml>
The labels do not necessarily need any 2nd anchor for your usecase except if you want to tell the ItemFlavor label to be anchored to the bottom of the tooltip. But the labels should resize themselves to the size they will need. Else you can set the Dimension Constraints for the labels as well so they will not get bigger than/smaller than...
If you anchor the middle label (TraitTypeText) to the RIGHT it will ALWAYS be the size from Divider to the middle (RIGHT) of the tlc (tooltip control).
And the following anchored label will then begin below that RIGHT (middle) of the tlc.
Thank you so much. I will try this!

I had to add the second anchor to the labels because they did not wrap without it. Dont know why.
  Reply With Quote