Thread Tools Display Modes
10-18-09, 04:41 AM   #1
xtothx
A Deviate Faerie Dragon
 
xtothx's Avatar
Join Date: Oct 2009
Posts: 18
Help with tags

Hi, its my first post here

I have problem with target tags for my ouf, exactly target name is overlapping the target classification :



I want to do it like this :



But I don't know how..

Also I want to make oUF showing non-player-target class, exactly like in 2nd screen.

Please help, and sorry for my english, I'm from Poland

Last edited by xtothx : 10-18-09 at 09:35 AM.
  Reply With Quote
10-18-09, 07:48 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
You need to use set the right anchor of your name fontstring to the left side of your target class and it will truncate automatically. You can also add some padding between them if you want.

name:SetPoint("RIGHT", WhateverYouCalledIt, "LEFT", -5, 0)
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
10-18-09, 08:16 AM   #3
xtothx
A Deviate Faerie Dragon
 
xtothx's Avatar
Join Date: Oct 2009
Posts: 18
Nah, it doesn't work ;/ The problem still exist. Anyway thanks for reply.

(I am using self-modified oUF_Luna)
  Reply With Quote
10-18-09, 09:10 AM   #4
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
What's your spawn function?

EDIT: See this page on wowwiki for more info about how dimensions from FontStrings can behave.

Last edited by ravagernl : 10-18-09 at 09:18 AM.
  Reply With Quote
10-18-09, 09:39 AM   #5
xtothx
A Deviate Faerie Dragon
 
xtothx's Avatar
Join Date: Oct 2009
Posts: 18
Code:
                 self.Info = self:CreateFontString(nil, self, 'GameFontHighlightSmallLeft')             
		self.Info:SetFont(font, fontsize)
                self.Info:SetPoint('RIGHT', self, 'LEFT', 140, -34)
		self:Tag(self.Info, '[white][name]')
I am beginner in lua, but thanks for link
  Reply With Quote
10-18-09, 10:37 AM   #6
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Originally Posted by xtothx View Post
Code:
                 self.Info = self:CreateFontString(nil, self, 'GameFontHighlightSmallLeft')             
		self.Info:SetFont(font, fontsize)
                self.Info:SetPoint('RIGHT', self, 'LEFT', 140, -34)
		self:Tag(self.Info, '[white][name]')
I am beginner in lua, but thanks for link
You misunderstood. You either need to explicitly set the width and height of your fontstring, or you need to set two anchors. One for the left side and one for the right side - you just have one for the right side.

lua Code:
  1. self.Info = self:CreateFontString(nil, self, 'GameFontHightlightSmallLeft')
  2. self.Info:SetFont(font, fontsize)
  3. -- main anchor
  4. self.Info:SetPoint('TOPLEFT', self, 'BOTTOMLEFT')
  5. -- right side anchor to truncate
  6. self.Info:SetPoint('RIGHT', YourClassificationFontstringName, 'LEFT')
  7. self:Tag(self.Info, '[white][name]')
  Reply With Quote
10-18-09, 03:32 PM   #7
xtothx
A Deviate Faerie Dragon
 
xtothx's Avatar
Join Date: Oct 2009
Posts: 18
Problem solved! Big thanks.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help with tags

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off