STAR TREK 2d20
  1. #1

    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>

  2. #2

  3. #3
    Thanks, I will give it a shot.

  4. #4
    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>

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,655
    Blog Entries
    1
    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

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in