WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   STUF, vertical text. (https://www.wowinterface.com/forums/showthread.php?t=45891)

Rusken 02-25-13 12:57 PM

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!

Kendian 02-25-13 02:41 PM

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

Rusken 02-25-13 03:05 PM

Quote:

Originally Posted by Kendian (Post 273457)
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:/

Fizzlemizz 02-25-13 03:09 PM

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.

Kendian 02-25-13 03:27 PM

1 Attachment(s)
Quote:

Originally Posted by Rusken (Post 273460)
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~

Rusken 02-25-13 03:50 PM

Quote:

Originally Posted by Kendian (Post 273462)
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?

Kendian 02-25-13 03:55 PM

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.

Rusken 02-27-13 09:35 AM

Ah i found the problem, thanks for the help.
I might ask another question while im at it:p
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?


All times are GMT -6. The time now is 03:30 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI