• Make own kinda derma?
    12 replies, posted
Alright so I've been wanting to make my own interface thing for a while now(Basically a copy of derma) but I've been wondering how derma does it. I'd like to know how I'd change the settings on a button forexample, with another function like in derma; Button = vgui.Create("DButton") and then Button:SetPos(). I've been wanting to do this for a while, not knowing how to. I've been wondering about how I would create the vgui.Create function aswell because how does it find 'DButton' when you write it in? Either way, hopefully someone can help and hopefully people understand.
I don't quite understand what you are looking to do but I'm assuming you want to [I]reskin[/I] derma. There are two ways of doing that, overriding the [B]Paint()[/B] function of a VGUI element or making your own skin with a texture file using GWEN.
[QUOTE=_FR_Starfox64;46431656]I don't quite understand what you are looking to do but I'm assuming you want to [I]reskin[/I] derma. There are two ways of doing that, overriding the [B]Paint()[/B] function of a VGUI element or making your own skin with a texture file using GWEN.[/QUOTE] No, not reskin. Make my OWN derma, just not called derma :V Like where I have my own functions and stuff for making an element on the screen, just like the 'vgui.Create("DButton")'. Also, how if I made a normal function for creating a box on my screen, then how would I set its position with another function, just like SetPos?
[CODE] local PANEL = {} function PANEL:Init() end function PANEL:Paint() end vgui.Register("MyDerma", PANEL, "Base?") [/CODE] [B][URL="http://wiki.garrysmod.com/page/vgui/Register"]vgui.Register()[/URL][/B]
[QUOTE=_FR_Starfox64;46431791][CODE] local PANEL = {} function PANEL:Init() end function PANEL:Paint() end vgui.Register("MyDerma", PANEL, "Base?") [/CODE] [B][URL="http://wiki.garrysmod.com/page/vgui/Register"]vgui.Register()[/URL][/B][/QUOTE] I don't think you get it :/ vgui.Register will register it as a derma element, I wanted to make my own stuff, not related to derma.. Like my own library I guess I can call it
[QUOTE=Kevin;46431845]I don't think you get it :/ vgui.Register will register it as a derma element, I wanted to make my own stuff, not related to derma.. Like my own library I guess I can call it[/QUOTE] Look into the draw.* and surface.* functions.
[QUOTE=HumbleTH;46431862]Look into the draw.* and surface.* functions.[/QUOTE] Uh yeah I know that but how would I use SetPos and stuff for it? I thought of making a function that makes a box with draw.* or surface.* but I don't know how to set its pos with another function. This is just for organizing because I like the way derma does it.
What do you want to change, theres no point in making your own library.
Oh well. I might just have to figure it out myself. I don't wanna change anything, I just wanna make my own but I have no idea how I'd make the functions for it which I'm asking for here but I apparently suck at explaining so yeah..
[QUOTE=Kevin;46431964]I don't wanna change anything, [b]I just wanna make my own[/b][/QUOTE] It's called "reinventing the wheel" when you recreate something that already exists and reliably works just because it wasn't created by you. And it's essentially just a waste of time, you'll spend a lot of time making/debugging stuff like parenting controls to other control, handling focus of things like textboxes...
[QUOTE=mijyuoon;46432006]It's called "reinventing the wheel" when you recreate something that already exists and reliably works just because it wasn't created by you. And it's essentially just a waste of time, you'll spend a lot of time making/debugging stuff like parenting controls to other control, handling focus of things like textboxes...[/QUOTE] So? Am I dumb because this is what I wanna do? I'm simply asking for a little thing that other people might know how to do. This is for learning and I don't really care if I'm "reinventing the wheel" because it's my own little project.
Look at how derma is made on [URL="https://github.com/garrynewman/garrysmod"]GitHub[/URL].
[QUOTE=_FR_Starfox64;46432051]Look at how derma is made on [URL="https://github.com/garrynewman/garrysmod"]GitHub[/URL].[/QUOTE] Alright thank you. I'll close the thread now anyways.
Sorry, you need to Log In to post a reply to this thread.