Thread: Create a Button
View Single Post
11-26-09, 03:30 PM   #1
kenuvis
A Defias Bandit
Join Date: Nov 2009
Posts: 3
Create a Button

Its so simple, but i am to silly.

i want simply create a button in lua using that:

Code:
        local button = CreateFrame("Button", "only_for_testing", mainframe)
        button:SetPoint("CENTER", mainframe, "CENTER", 0, 0)
        button:SetWidth(200)
        button:SetHeight(50)
        
        button:SetText("My Test")
        button:SetNormalFontObject("GameFontNormalSmall")
        
        button:SetNormalTexture("Interface/Buttons/UI-Panel-Button-Up")
        button:SetHighlightTexture("Interface/Buttons/UI-Panel-Button-Highlight")
        button:SetPushedTexture("Interface/Buttons/UI-Panel-Button-Down")
I see the button but the text is set to the bottomleft of the button and it seems so, i can do, whatever i want, i dont get it to the center of the button.

Last edited by kenuvis : 11-26-09 at 04:24 PM.
  Reply With Quote