What's the best way to draw some text vertically on the HUD?
So basically, drawing some text, and rotating it 90 degrees?
the way i would do it is like
[lua]
local words = {"t", "h", "i", "s", " ", "i", "s", " ", "r", "e", "d", "i", "c", "u", "l", "o", "u", "s"}
for k, v in pairs(words) do
draw.SimpleText(v, "ScoreboardText", 2, 5 + (k * 20), Color(0, 0, 0, 255))
end
[/lua]
seems like there is a better way though
If you wanted to rotate the characters themselves, I don't believe there is a way to do that in GLua. You would need to create a texture or .tga image instead.
You could do it with a 3D2D camera, although that is a lot of effort to rotate text.
Try this [lua]
MySpacing = 5 // spacing between each letter
MyString = "Waggle Fraggle" //the string
MyTab = string.ToTable(MyString)//the table of the string
for i=1, table.Count(MyTab) do
draw.SimpleText(tab[i], "ScoreboardText", x,y +(i*MySpacing), Color(255, 255, 50, 255))
end
[/lua]
It converts the string into a table then reads in each one.
EDIT: there made it do what you want
If you're doing a rotated cam, why would you need to draw each letter separately?
so you can read it like this
H
e
l
l
o
!
rather then the word just being rotated 90 degrees
But to do that, you wouldn't need a cam.
Well if he wants it to be in the world he would but i just mis-read post the rotate 90 degrees threw me off.
I was really looking to rotate each character aswell, but I guess printing each one in a loop could work.
Thanks for the help.
Sorry, you need to Log In to post a reply to this thread.