the derma menu works and everything, but only thing is that the picture is big mess.. it's getting dark.. and looking like in old days when someone recorded a screen :P
plz help, i have no idea what to do
[lua]
local GovermentPicture = vgui.Create( "DImage" )
GovermentPicture:SetParent( DPanel1 )
GovermentPicture:SetPos( 5, 40 )
GovermentPicture:SetImage( "no_name/goverment_selectteam_picture.vtf" )
GovermentPicture:SetSize( 255, 300 )
[/lua]
[editline]9th July 2012[/editline]
so i changed my code a little bit..
[lua]
local player = LocalPlayer()
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 590, 390 )
DermaPanel:SetTitle( "Select Team" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false )
DermaPanel:ShowCloseButton( false )
--local DPanel1 = vgui.Create('DPanel')
--DPanel1:SetParent( DermaPanel )
--DPanel1:SetSize(580, 355)
--DPanel1:SetPos(5, 30)
local GovermentPicture = vgui.Create( "DImage" )
GovermentPicture:SetParent( DermaPanel )
GovermentPicture:SetPos( 10, 70 )
GovermentPicture:SetImage( "no_name/goverment_selectteam_picture.vtf" )
GovermentPicture:SetSize( 255, 300 )
[/lua]
well i just commted the DPanel.. seems like a fix, but really? why can't i have a Image on a Panel ? :((
[QUOTE=grunewald;36688133]well i just commted the DPanel.. seems like a fix, but really? why can't i have a Image on a Panel ? :(([/QUOTE]
You can! Here is why your picture was most likely dark..
Your picture must be parented to the DPanel and the Dpanel to the DFrame. Here, you have the image and the panel parented to the frame.
[lua]
local player = LocalPlayer()
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 590, 390 )
DermaPanel:SetTitle( "Select Team" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false )
DermaPanel:ShowCloseButton( false )
local DPanel1 = vgui.Create('DPanel')
DPanel1:SetParent( DermaPanel )
DPanel1:SetSize(580, 355)
DPanel1:SetPos(5, 30)
local GovermentPicture = vgui.Create( "DImage" )
--Here the picture needs to be parented to the panel, not the frame.
--GovermentPicture:SetParent( DermaPanel )
GovermentPicture:SetParent( DPanel1 )
GovermentPicture:SetPos( 10, 70 )
GovermentPicture:SetImage( "no_name/goverment_selectteam_picture.vtf" )
GovermentPicture:SetSize( 255, 300 )
[/lua]
thanks man!
Sorry, you need to Log In to post a reply to this thread.