• Graphing in Derma
    2 replies, posted
I don't suppose it'd be possible to make a line graph in Derma? If not, what about a bar graph?
At the very least, you can use vgui.Register to create your own controls. [lua] jcon.reg.form = { Init = function(self) local dat = self:GetParent():GetTable() dat.m = { x=0, y=0, } dat.scroll = 1 end, Paint = function(self) local dat = self:GetParent():GetTable() local m = dat.m --lots of code-- if m.c == -1 then m.c = 0 end end, OnCursorMoved = function(self,x,y) local dat = self:GetParent():GetTable() dat.m.x = x dat.m.y = y end, OnCursorExited = function(self) local dat = self:GetParent():GetTable() dat.m.x = 0 dat.m.y = 0 dat.m.c = 0 dat.m.f = 0 end, OnMousePressed = function(self,mc) local dat = self:GetParent():GetTable() dat.m.c = 1 dat.m.f = 0 end, OnMouseReleased = function(self,mc) local dat = self:GetParent():GetTable() dat.m.c = -1 end, OnMouseWheeled = function(self,delta) local dat = self:GetParent():GetTable() local scrollmax = 1 if dat.tabcat then scrollmax = #jcon.reg.cat[dat.tabcat] end dat.scroll = math.Clamp(dat.scroll - delta,1,math.max(1,scrollmax-8)) end, } vgui.Register("jfigmenu",jcon.reg.form) [/lua] ^ This code does nothing, I just ripped it out of joystick module. I think you could just make a label and override its paint function, however.
*cough* That, er... That's. That does... *cough* What the hell /is/ that?
Sorry, you need to Log In to post a reply to this thread.