Adding a picture to the button

How do you add a picture/model to your button in the vgui

this is my current code for the button

local AButton = vgui.Create( "DButton", BackGround )
AButton:SetSize(150, 80 )
AButton:SetText( "Ak47" )
AButton:SetPos( 50, 20 )
AButton.DoClick = function ()
	ply:ConCommand("Give weapon_ak47")
end

Do i add a AButton:SetPic(File name) or is it something more complicated?

**[Panel.Paint

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Panel.Paint)**

Stop making so many threads use http://luasearch.overvprojects.nl/ to search
or post in one of your other threats for example this would have been fine in the last menu thread you posted

thats all fine and well and im sorry for spamming your forum. However no offence intended but your not really helping me much.

This is supposed to be the “newbie” section and your just giving me a link. I dont know where im supposed to put this code, or how im supposed to put it in.
And i dont see how drawing the word “hello” is ANYTHING to do with a background picture for my button

:frowning:

Edit:

Sorry for getting annoyed, im going to go to sleep now, thanks for all the help :slight_smile:

Night

Well you can use the draw library to draw over the button in a panel paint function with

**[Surface.DrawTexturedRect

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Surface.DrawTexturedRect)**

and example of doing this is here

**[DButton.Paint

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=DButton.Paint)**

or you can use
[lua]
DButton.SetImage()
[/lua]

DImageButton anyone?

Wasn’t this question already answered in the wiki?
The one about basic derma?

edit: Yes, i do believe it was mentioned in there.

Look at the example in the middle.

It’s not me who’s asking the question.