Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

DImageButton wont work #21

Open
XxLMM13xXgaming opened this issue Aug 30, 2017 · 0 comments
Open

DImageButton wont work #21

XxLMM13xXgaming opened this issue Aug 30, 2017 · 0 comments

Comments

@XxLMM13xXgaming
Copy link

XxLMM13xXgaming commented Aug 30, 2017

Is this because it was never supported, just a bug or am I doing something wrong....

My code:

	local DFrame = vgui.Create( "DFrame" )
	DFrame:SetTitle( "" )
	DFrame:SetPos( 0, 0 )
	DFrame:SetSize( 920, 450 )
	DFrame:SetDraggable(false)
	DFrame:ShowCloseButton(false)
	DFrame.Paint = function(s, w, h)
		draw.SimpleText("Blah","DermaLarge",w / 2,20,Color( 0, 0, 0, 255 ),TEXT_ALIGN_CENTER,TEXT_ALIGN_TOP)
	end

	local InfoBtn = vgui.Create( "DImageButton", DFrame )
	InfoBtn:SetPos( 10, 345 )
	InfoBtn:SetImage( "icon16/information.png" )
	InfoBtn:SizeToContents()
	InfoBtn.DoClick = function()
		LocalPlayer():ChatPrint("Hey lmao")
	end

	local testbtn = vgui.Create("DButton", DFrame)
	testbtn:SetPos(200, 100)
	testbtn:SetSize(100,100)
	testbtn:SetText("Text")
	testbtn.DoClick = function()
		LocalPlayer():ChatPrint("Hey lmao")
	end

That looks like this

The desk

As you can see the 3 main components... The title at the top, the big test button, and the small info logo button.

If I click the big button I get a "Hey lmao" message in my chat box however when I click that little logo... I get nothing... So the main issue is that DImageButtons are not working. Maybe it's something I did wrong? I'm not sure but thanks for reading!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant