Hello,
does there a function called DModelPanel.DoClick exist?
When no is there a way making something like that?
I would be happy if someone can post a code or something.
Thanks
Of course. Enable mouse on Init:: self:SetMouseInputEnabled( true ) :: and :
[lua]function PANEL:OnCursorMoved( cursorX, cursorY )
end
function PANEL:OnMousePressed( keyCode )
if ( keyCode == MOUSE_MIDDLE ) then
end
if ( keyCode == MOUSE_LEFT ) then
end
if ( keyCode == MOUSE_RIGHT ) then
end
end
function PANEL:OnCursorExited( cursorX, cursorY )
end
function PANEL:OnMouseReleased( keyCode )
end
function PANEL:OnMouseWheeled( delta )
end
[/lua]
If i have a code like :
local dpanel1 = vgui. Create(DModelPanel)
dpanel1.setpos(50,50)
Dpanel1.setsize(25,25)
How do I add that Then?
Sorry for mistakes I am on my Mobile
[code]function dpanel1:OnMousePressed( keyCode )
/*code*/
end[/code]
There's no OnClick for DModelPanel. Only OnMousePressed.
[IMG]http://i.gyazo.com/0304872b889684308468b35631319e00.png[/IMG]
the dmodel frame does not show up... any ideas?
Are you sure it is not showing up and not the fact that you might not just see the model on it? I mean check your camera angles and position.
Also, SizeToContents is not needed for DModelPanel.
yea i am sure its not showing up... i have also a text label which is parented to this modelpanel...its not showing up as well.
can anyone help?
Remove the SizeToContents call, make the panel bigger and see what happens.
Sorry, you need to Log In to post a reply to this thread.