Reply
Thread Tools Display Modes
Unread 02-25-13, 12:57 PM   #1
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
STUF, vertical text.

Evening, i wonder if there is anyone here that knows how to get a unitframes playername to become vertical in stuf?
What i want is for my pet and focus to look like this ->

N
a
m
e

B
e
a
s
t

There is an option in the stuf texts to add a custom lua but i dont know a thing about lua, so is there any kind soul with them awesome lua skills that could help me with this (if its possible)?<3
Thanks!
Rusken is offline   Reply With Quote
Unread 02-25-13, 02:41 PM   #2
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
As far as I know this still works, to a certain extent.

Code:
function(unit, cache, textframe) 
     local name = UnitName( unit )
     if name ~= nil then
          local strLen = strlen( name )
          local tmp = ''
          local outStr = ''
 
          if strLen > 14 then
               strLen = 14
          end
 
          for i = 1, strLen, 1 do
               tmp = strsub( name, i, i )
               if i == 1 then
                    outStr = outStr..tmp
               else
                    outStr = outStr..'\n'..tmp
               end
          end
 
          return '%s', outStr
     end
end
It was taken from the forum posts here Stuf Custom Lua
__________________
Kendian is offline   Reply With Quote
Unread 02-25-13, 03:05 PM   #3
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
Originally Posted by Kendian View Post
As far as I know this still works, to a certain extent.

Code:
function(unit, cache, textframe) 
     local name = UnitName( unit )
     if name ~= nil then
          local strLen = strlen( name )
          local tmp = ''
          local outStr = ''
 
          if strLen > 14 then
               strLen = 14
          end
 
          for i = 1, strLen, 1 do
               tmp = strsub( name, i, i )
               if i == 1 then
                    outStr = outStr..tmp
               else
                    outStr = outStr..'\n'..tmp
               end
          end
 
          return '%s', outStr
     end
end
It was taken from the forum posts here Stuf Custom Lua
Nope that didn't work:/
Rusken is offline   Reply With Quote
Unread 02-25-13, 03:09 PM   #4
Fizzlemizz
A Frostmaul Preserver
 
Fizzlemizz's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 255
text = string.gsub(text, "(.)", function(x) return x.."\n" end)

where text is the string you want to display vertically.

You also have to set the height of your fontstring tall enough to hold the text.
__________________
FizzleMizz Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle

Last edited by Fizzlemizz : 02-25-13 at 03:25 PM.
Fizzlemizz is offline   Reply With Quote
Unread 02-25-13, 03:27 PM   #5
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Originally Posted by Rusken View Post
Nope that didn't work:/
You need to thin the width and lengthen the height of the text box, because I assure it does, although it IS pretty basic~
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	190
Size:	13.3 KB
ID:	7583  
__________________
Kendian is offline   Reply With Quote
Unread 02-25-13, 03:50 PM   #6
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
Originally Posted by Kendian View Post
You need to thin the width and lengthen the height of the text box, because I assure it does, although it IS pretty basic~
I must be doing something wrong, i open stuf, go to pet, choose text 1 and select "use custom lua", then i paste this in there and press ok ->

Code:
function(unit, cache, textframe) 
     local name = UnitName( unit )
     if name ~= nil then
          local strLen = strlen( name )
          local tmp = ''
          local outStr = ''
 
          if strLen > 14 then
               strLen = 14
          end
 
          for i = 1, strLen, 1 do
               tmp = strsub( name, i, i )
               if i == 1 then
                    outStr = outStr..tmp
               else
                    outStr = outStr..'\n'..tmp
               end
          end
 
          return '%s', outStr
     end
end
After this nothing appears, i tryed changing the width, height, font size, strata, everything.
What am i doing wrong?
Rusken is offline   Reply With Quote
Unread 02-25-13, 03:55 PM   #7
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Make sure your disable text is not checked, then make sure a font/size/tag is selected. Easy way to see where its supposed to be, is check the box (top right of GUI) highlight target.
__________________
Kendian is offline   Reply With Quote
Unread 02-27-13, 09:35 AM   #8
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
Ah i found the problem, thanks for the help.
I might ask another question while im at it
This one is regarding weakauras and kgpanels.
I've made a progressbar in weakauras that tracks demo locks demonic fury, i do however want 2 x kgpanels to be parented to it but since weakauras dont get an unique name for anchoring/parenting i wonder if there's another way to do this?
Like using some script or something?
Rusken is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » STUF, vertical text.

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