Thread: Simple Default Text Alignment?
-
August 2nd, 2020, 22:33 #1
- Join Date
- Jun 2019
- Posts
- 71
Simple Default Text Alignment?
This seems like it should be fairly simple to do, but I'm stumbling with it.
I would like to get the <Default> text in a template to align to the right. I've tried using offset, the font tag, even html markup in the text to no avail. Any advice would be appreciated.
Picture of what I have...wanting to align text to the right. The circle and the bar are two separate frames.
san_ms.png
Related code below:
Code:<!-- template for horz bar background with default "sanity" text --> <template name="saves_label"> <label> <frame mergerule="replace" name="statframe_rt_ms" offset="0,0,0,0" /> <static /> <disabled /> <tooltip /> <anchored position="belowleft" offset="10,12" width="91" height="38" /> </label> </template> <!-- circle number box --> <template name="number_saves"> <basicnumbernh_ms> <frame mergerule="replace" name="statbox_rt_ms" offset="0,0,0,0" /> <tooltip><text>Click to Edit.</text></tooltip> <anchored position="belowleft" offset="0,12" width="38" height="38" /> </basicnumbernh_ms> </template> <!-- Frame for horz bar with default tex --> <framedef name="statframe_rt_ms"> <bitmap file="graphics/frames/statlabelbg_r_ms.png" /> <offset>0,0,0,0</offset> </framedef> <!-- Character Saves --> <saves_label name="label_sanity"> <anchored to="charstats" position="insidetopleft" offset="250,35" /> <default>SANITY</default> </saves_label> <number_saves name="sanity" > <anchored to="charstats" position="insidetopleft" offset="341,35" /> <tooltip textres="" /> </number_saves>
-
August 2nd, 2020, 22:52 #2
define the number first and then anchor to the number
-
August 2nd, 2020, 22:56 #3
- Join Date
- Jun 2019
- Posts
- 71
Thanks, I will give it a shot.
-
August 2nd, 2020, 23:06 #4
- Join Date
- Jun 2019
- Posts
- 71
Gave it a shot, getting the same result unless I misunderstood your suggestion.
san_ms.png
Here is the new code
Code:<!-- Character Saves --> <number_saves name="sanity" > <anchored to="charstats" position="insidetopleft" offset="341,35" /> <tooltip textres="" /> </number_saves> <saves_label name="label_sanity"> <anchored to="sanity" position="insidetopleft" offset="-91,0" /> <default>SANITY</default> </saves_label>
-
August 2nd, 2020, 23:15 #5
try something like this:
<anchored to="sanity">
<top />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
i have to trial and error my anchors a lot but I think you want to anchor to an object "right"
its very likely my example is not correct but try some others in that direction
-
August 3rd, 2020, 00:05 #6
- Join Date
- Jun 2019
- Posts
- 71
Thanks damned. Played around with the anchors and got it to work, but decided to go with a string label instead of the default tag for the element. I guess the string would be better for future localization and the like anyway?
This is what I have now and how it looks:
sanity_ms.png
Code:<!-- Character Saves --> <saves_label name="label_sanity"> <anchored to="charstats" position="insidetopleft" offset="250,35" /> </saves_label> <string_label name="char_saves_sanity"> <anchored to="charstats" position="insidetopleft" offset="292,44" /> <default>SANITY</default> </string_label> <number_saves name="sanity" > <anchored to="charstats" position="insidetopleft" offset="341,35" /> <tooltip textres="" /> </number_saves>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks