• Weid bug when painting DTextEntries
    3 replies, posted
Hi there, so I'm developing a derma menu and I'm using a DTextEntry... To add some spiciness to the menu I'm painting the TextEntry, which looks sexy and works great. But when I restart my server and go in the menu. There's no text in the text entry, I can still type in it and it works. But no text is displayed. I have to lua refresh the server for it to appear... Which is strange. The problem does not occur if I do not Paint the DTextEntry. I'm developing this on a Nutscript gamemode server if that matters. DTextEntry issue (Streamable Video) Thanks for the support in advance, Cheers!
How about some code? We arent really able to do anything without it.
I had this issue while developing a private Bitminer addon, i fixed it by adding a DrawTextEntryText() to the paint function of the DTextEntry.
@Trackster Yeah, sorry about that. I forgot to actually put it in... panel.search = panel:Add("DTextEntry") panel.search:SetSize(200,40) panel.search:SetFont("nutSmallFont") panel.search.placeholder = "Name Filter" panel.search:SetText(panel.search.placeholder) function panel.search:Think() local val = self:GetText() if self:IsEditing() and val == self.placeholder then self:SetText("") end if not self:IsEditing() and #val == 0 then self:SetText(self.placeholder) end end function panel.search:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(35,35,35)) self:DrawTextEntryText(color_white, Color(0, 138, 255), color_white) end
Sorry, you need to Log In to post a reply to this thread.