GMod - What are you working on? February 2015 (#42)

Lots of good content in last month’s WAYWO, so I’ll make this OP a bit bigger for you all!

Highlights from the previous thread

With that gasmask highlight I thought for a moment that someone had modded in Oculus Rift support.

if only

After a few preliminary tests, I’ve concluded that Luabee-based job creation would be, unfortunately, very impractical:

There’s just TOO MANY arguments lol. The block was about twice the size of my screen, and Luabee doesn’t have a zoom function (because how the fuck would you even zoom derma anyway?)

you could mess with scales and positions, but you would have to use matrices or draw to a rendertarget or something for drawn stuff

Currently working on mesh decal with VertexLitGeneric.
Do anyone know how do I make them have proper lighting?[/t]

It works with certain angle


render.SetLightmapTexture not working?

Yeah I thought about scales and positions, but text was the big one. It would probably have to be a render target.

That said, wouldn’t it be useful if there were a DZoomPanel which drew all its children using a matrix?

It does work, but only with static IMeshes, and you have to pass a LightmappedGeneric material
as a ‘hint’ for the IMesh constructor.

What ever happened to Coffee’s Flappy Bird on my phone? I still want to play it :confused:

Awesome! I made the highlights with my pixel renderer (that eventually got me banned, darn.).

Sampler looks so awesome. I hope PelPix123 opensources it.

It would be plain greedy to keep that to hisself.

[lua]local pnl = vgui.Create(“DPanel”)
pnl:SetSize(512, 512)

pnl.Paint = function(self, w, h)
surface.SetDrawColor(40, 40, 40)
surface.DrawRect(0, 0, w, h)

surface.SetDrawColor(120, 120, 120)
surface.DrawOutlinedRect(0, 0, w, h)

surface.SetTextColor(255, 255, 255)
surface.SetTextPos(8, 8)
surface.DrawText("Scalable panel proof of concept")



pnl.ow, pnl.oh = pnl:GetSize()
pnl.ox, pnl.oy = pnl:GetPos()

pnl.matrix = Matrix({
{1, 0, 0, pnl.ox},
{0, 1, 0, pnl.oy},
{0, 0, 0, 0},
{0, 0, 0, 0}

pnl.zoom = function(self, frac)
self:SetSize(self.ow * frac, self.oh * frac)
self:SetPos(self.ox * frac, self.oy * frac)

self.matrix:SetScale(Vector(frac, frac))
self.matrix:SetTranslation(Vector(self.ox * frac, self.oy * frac))


local function drawpnl()
pnl:Paint(pnl.ow, pnl.oh)
hook.Add(“HUDPaint”, “asdkajshdjkahs”, drawpnl)[/lua]

done quick, and I’m sure more would have to be done, but you get the idea

But how would you translate the mouse clicks back into the derma?

the panel’s the right size and everything, you would just have to scale all the children down too

Maybe I just don’t understand what I’m looking at, but it seems to me that you’re creating a panel and just visually drawing it smaller. You’re not changing the actual panel size. In my mind it’s as if you’re doing the equivalent of drawing it to a render target and then displaying it somewhere on the screen. Like a keyboard behind glass.

I’m physically changing the size/pos of the panel, but I’m also visually shrinking everything so that it looks the same even though it’s smaller

my version on the left, just setsize on the right:

What if you just don’t include all of the variables at once. Just start off with the required ones like name, model and whatever else. But have the ability to add more variables like map etc.

Add a button and tell me if it clicks when it’s supposed to.

I doubt it will considering the code doesn’t modify children. You’d have to add that.


I thought about that, but I was hoping not to have to rewrite ALL of Luabee just to accommodate a potential usage of it. There’s no saying it will even be preferred when it’s done; no guarantee of success.

add the function to every panel and you could just add

[lua]for k, v in pairs(self:GetChildren()) do v:zoom(frac) end[/lua]

to panel.zoom

this whole thing was just a proof of concept though, I was just letting you know that it can be done

Thanks I’ll look into it.