Josh Posted April 19, 2015 Share Posted April 19, 2015 This is a set of classes I created for the basis of a GUI system, done what I think is the "right" way. It handles clipping, parenting, transforming screen coordinates, events, etc. You can just copy the button class and create new GUI elements based on the GUIControl base class. GUITest.zip 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted April 19, 2015 Share Posted April 19, 2015 I can't see how we know when the button is clicked in your example. Where is the event handler for it's click event? If you go the Java route (which blows imho) we'd derive our own classes from a listener class that has virutal methods that gets called from the gui engine and inside we check what control fired them. Personally I think the .NET method is way better where we register C++ methods as callbacks to the events. In C++ this can get fairly complicated, but C++ people would know what's up. It should be really easy to define event callbacks in Lua though if you plan to bring it there. Does this handle different screen resolutions and aspect ratios? Anchoring, like Agror's GUI, seems to be the best way to handle control placements, and he has some calc's for control sizes based on a base resolution. This part is really the bread and butter of any GUI because this is the trickier part. Can't lock users into 1 resolution. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 19, 2015 Author Share Posted April 19, 2015 Actually, all it does is print that it was pressed. So you would want to create an event list or add a callback function. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted April 19, 2015 Share Posted April 19, 2015 You should put this on sourceforge so LE'ers can contribute to it and fill it out over time since it's pretty bare bones atm. Some of the most complicated pieces are still needed. Or you could fill it out and make it really solid and sell it as a Workshop item for extra revenue! Quote Link to comment Share on other sites More sharing options...
Josh Posted April 19, 2015 Author Share Posted April 19, 2015 It's updated to include an event queue. Do what you want with it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
CreativeOcclusion Posted April 19, 2015 Share Posted April 19, 2015 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.