DImage not rendering proberbly

For some reason my DImages are not rendering right i have Seven on one menu i don’t know if that causes the problems.
I’m just making a derma menu extension to my date system, so you can chose which days you will work.

I have 7 buttons and 7 Images, so don’t mind i took the last ones.

Problems:

  1. Image renders half?? [!FIXED!]
  2. Image makes texture error. [!FIXED!] Apprently the Vtf files said something else than i wanted to.
  3. Sometimes more pictures re-render wrongly with one button. [!FIXED!] I looked at the object positions and i saw some of there were wrong.
  4. A black box instead of the picture and makes a picture 5 seconds later. [!FIXED!]
  5. Some pictures does not want to change to the other.

These problems does not seems to be the same on each picture some pictures does the first other’s ´the second while some pictures render as they should.

The DImage

[LUA]
local DImage7 = vgui.Create(‘DImage’, DaysPanel )
DImage7:SetSize(60, 30)
DImage7:SetPos(163, 87)
DImage7:SetImage(‘VGUI/icon_sun’)
[/LUA]

The button there changes the image

[LUA]
local DSysButton7 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton7:SetSize(25, 25)
DSysButton7:SetPos(133, 92)
DSysButton7:SetType(‘tick’)
DSysButton7.DoClick = function()
if DImage7:GetImage() == “VGUI\hammers” then
DImage7:SetImage(‘VGUI/icon_sun’) else
DImage7:SetImage(‘VGUI/hammers’)
end
end
[/LUA]

You are setting the image to icon_sun and checking if it is icon-sun?

You are right, but no all the other images are right except this and the first image does not render proberbly.

You will get a texture error if you do not have the texture as the client. This can be fixed by resourcing the file.

i have the files, but i’ll try anyway.

============================
EDIT:

Does not work.

Can you show full code please.

Sure.

And the is at the top:
resource.AddSingleFile(“materials/VGUI/sun_icon.vtf”)
resource.AddSingleFile(“materials/VGUI/hammers.vtf”)
resource.AddSingleFile(“materials/VGUI/sun_icon.vmf”)
resource.AddSingleFile(“materials/VGUI/hammers.vmf”)

[LUA]
function daysmenu()
local DaysPanel = vgui.Create(‘DPanelList’)
DaysPanel:SetSize(549, 357)
DaysPanel:SetPos(5, 25)
DaysPanel:SetSize(750, 550)
DaysPanel:Center()
DaysPanel:MakePopup( )
DaysPanel:SetSpacing(5)
DaysPanel:AddItem(DImage1)
DaysPanel:AddItem(DImage2)
DaysPanel:AddItem(DImage3)
DaysPanel:AddItem(DImage4)
DaysPanel:AddItem(DImage5)
DaysPanel:AddItem(DImage6)
DaysPanel:AddItem(DImage7)
DaysPanel:AddItem(DSysButton1)
DaysPanel:AddItem(DSysButton2)
DaysPanel:AddItem(DSysButton3)
DaysPanel:AddItem(DSysButton4)
DaysPanel:AddItem(DSysButton5)
DaysPanel:AddItem(DSysButton6)
DaysPanel:AddItem(DSysButton7)

local DaysLabel = vgui.Create(‘DLabel’, DaysPanel )
DaysLabel:SetPos(63, 97)
DaysLabel:SetText(‘Monday’)

local DLabel2 = vgui.Create(‘DLabel’, DaysPanel )
DLabel2:SetPos(63, 136)
DLabel2:SetText(‘Tuesday’)

local DLabel3 = vgui.Create(‘DLabel’, DaysPanel )
DLabel3:SetPos(61, 377)
DLabel3:SetText(‘Wednessday’)

local DLabel4 = vgui.Create(‘DLabel’, DaysPanel )
DLabel4:SetPos(59, 326)
DLabel4:SetText(‘Thursday’)

local DLabel5 = vgui.Create(‘DLabel’, DaysPanel )
DLabel5:SetPos(59, 279)
DLabel5:SetText(‘Friday’)

local DLabel6 = vgui.Create(‘DLabel’, DaysPanel )
DLabel6:SetPos(62, 228)
DLabel6:SetText(‘Saturday’)

local DLabel7 = vgui.Create(‘DLabel’, DaysPanel )
DLabel7:SetPos(63, 182)
DLabel7:SetText(‘Sunday’)

local DImage1 = vgui.Create(‘DImage’, DaysPanel )
DImage1:SetSize(60, 30)
DImage1:SetPos(163, 373)
DImage1:SetImage(‘VGUI/icon_sun’)

local DImage2 = vgui.Create(‘DImage’, DaysPanel )
DImage2:SetSize(60, 30)
DImage2:SetPos(163, 320)
DImage2:SetImage(‘VGUI/icon_sun’)

local DImage3 = vgui.Create(‘DImage’, DaysPanel )
DImage3:SetSize(60, 30)
DImage3:SetPos(163, 219)
DImage3:SetImage(‘VGUI/hammers’)

local DImage4 = vgui.Create(‘DImage’, DaysPanel )
DImage4:SetSize(60, 30)
DImage4:SetPos(163, 271)
DImage4:SetImage(‘VGUI/hammers’)

local DImage5 = vgui.Create(‘DImage’, DaysPanel )
DImage5:SetSize(60, 30)
DImage5:SetPos(163, 173)
DImage5:SetImage(‘VGUI/hammers’)

local DImage6 = vgui.Create(‘DImage’, DaysPanel )
DImage6:SetSize(60, 30)
DImage6:SetPos(163, 134)
DImage6:SetImage(‘VGUI/hammers’)

local DImage7 = vgui.Create(‘DImage’, DaysPanel )
DImage7:SetSize(60, 30)
DImage7:SetPos(163, 87)
DImage7:SetImage(‘VGUI/icon_sun’)

local DSysButton1 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton1:SetSize(25, 25)
DSysButton1:SetPos(132, 371)
DSysButton1:SetType(‘tick’)
DSysButton1.DoClick = function()
if DImage1:GetImage() == “VGUI/hammers” then
DImage1:SetImage(‘VGUI/icon_sun’) else
DImage1:SetImage(‘VGUI/hammers’)
end
end

local DSysButton2 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton2:SetSize(25, 25)
DSysButton2:SetPos(122, 321)
DSysButton2:SetType(‘tick’)
DSysButton2.DoClick = function()
if DImage2:GetImage() == “VGUI/hammers” then
DImage2:SetImage(‘VGUI/icon_sun’) else
DImage2:SetImage(‘VGUI/hammers’)
end
end

local DSysButton3 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton3:SetSize(25, 25)
DSysButton3:SetPos(132, 271)
DSysButton3:SetType(‘tick’)
DSysButton3.DoClick = function()
if DImage3:GetImage() == “VGUI\hammers” then
DImage3:SetImage(‘VGUI/icon_sun’) else
DImage3:SetImage(‘VGUI/hammers’)
end
end

local DSysButton4 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton4:SetSize(25, 25)
DSysButton4:SetPos(132, 222)
DSysButton4:SetType(‘tick’)
DSysButton4.DoClick = function()
if DImage4:GetImage() == “VGUI/hammers” then
DImage4:SetImage(‘VGUI/icon_sun’) else
DImage4:SetImage(‘VGUI/hammers’)
end
end

local DSysButton5 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton5:SetSize(25, 26)
DSysButton5:SetPos(132, 173)
DSysButton5:SetType(‘tick’)
DSysButton5.DoClick = function()
if DImage5:GetImage() == “VGUI\hammers” then
DImage5:SetImage(‘VGUI/icon_sun’) else
DImage5:SetImage(‘VGUI/hammers’)
end
end

local DSysButton6 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton6:SetSize(26, 25)
DSysButton6:SetPos(132, 132)
DSysButton6:SetType(‘tick’)
DSysButton6.DoClick = function()
if DImage6:GetImage() == “VGUI\hammers” then
DImage6:SetImage(‘VGUI/icon_sun’) else
DImage6:SetImage(‘VGUI/hammers’)
end
end

local DSysButton7 = vgui.Create(‘DSysButton’, DaysPanel )
DSysButton7:SetSize(25, 25)
DSysButton7:SetPos(132, 92)
DSysButton7:SetType(‘tick’)
DSysButton7.DoClick = function()
if DImage7:GetImage() == “VGUI\hammers” then
DImage7:SetImage(‘VGUI/icon_sun’) else
DImage7:SetImage(‘VGUI/hammers’)
end
end

return DaysPanel

end
[/LUA]