WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   SetFont: change flags, not size? (https://www.wowinterface.com/forums/showthread.php?t=39621)

Aprikot 04-13-11 02:53 PM

SetFont: change flags, not size?
 
I'm trying to set font flags while leaving font size alone. My first attempt used nil (no worky):
Code:

object:SetFont("file", nil, "flags")
My next attempt tries to reset the size to its default value (nope):
Code:

object:SetFont("file", (object:GetFont(select,2)), "flags")
I'm wondering if anyone can explain why method #1 doesn't work, and also correct the horribad syntax (and logic?) of my 2nd attempt. Thanks!

Nibelheim 04-13-11 02:58 PM

Select works as so:

Code:

select(index, table)
Code:

select(2, object:GetFont())

Aprikot 04-13-11 04:00 PM

Quote:

Originally Posted by Nibelheim (Post 234488)
Code:

select(2, object:GetFont())

Thank you...worked beautifully. :)

The file & flag args seem to like "nil", but not size. Is it a string versus number thing?

Nibelheim 04-13-11 04:04 PM

Quote:

Originally Posted by Aprikot (Post 234489)
Thank you...worked beautifully. :)

The file & flag args seem to like "nil", but not size. Is it a string versus number thing?

Probably just the way the function works. Flags is optional, so leaving that as nil poses no problem, and the function probably just uses the default game font if Font is nil.


All times are GMT -6. The time now is 09:42 PM.

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