Thread Tools Display Modes
04-13-11, 02:53 PM   #1
Aprikot
A Frostmaul Preserver
 
Aprikot's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 284
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!
  Reply With Quote
04-13-11, 02:58 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Select works as so:

Code:
select(index, table)
Code:
select(2, object:GetFont())
  Reply With Quote
04-13-11, 04:00 PM   #3
Aprikot
A Frostmaul Preserver
 
Aprikot's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 284
Originally Posted by Nibelheim View Post
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?
  Reply With Quote
04-13-11, 04:04 PM   #4
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Aprikot View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetFont: change flags, not size?

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