View Single Post
12-22-14, 08:38 AM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Simple Font Object Question

Hi all,

I seem to have forgot how to copy a font object because I want to use GameFontNormal except having it class coloured. The Global MUI_COLOR definitely works and shows the class colours and "missionbtn" is the name of the button I have created.

Do this works correctly to show the yellow/gold coloured text:
Lua Code:
  1. missionbtn:SetNormalFontObject("GameFontNormal");

But this code below is what I am using and does not copy / work correctly:

Lua Code:
  1. local font = CreateFont("MUI_ButtonFont");
  2. font:CopyFontObject("GameFontNormal");
  3. font:SetTextColor(MUI_COLOR.r, MUI_COLOR.g, MUI_COLOR.b, 1);
  4. missionbtn:SetNormalFontObject(font);
  5. missionbtn:SetHighlightFontObject(font);

It shows up as nothing, making the button text invisible.

Completely stuck because I thought this should work. Any help? ^^
Been on a long break from programming so probably just being really stupid!
  Reply With Quote