tjheldna Posted March 29, 2013 Share Posted March 29, 2013 Hi All, I created a C++ GUI system for LE2 and have been meaning to share it for quit a while. I've now adapted most of the main elements for LE3 and is cross platform...so here it is. The widgets only use the base drawText, drawRect etc so this works with LE with nothing additional to link etc. Installation: Create a new LE3 project an replace the source with the archive files. Open up VS and include the files into the project. Overwrite App.cpp Add the sound and image files. Please Note: This is a work in progress I am forever optimising it. I would greatly appreciate it if someone does make a nice optimisation/create a new widget to share and I'll gladly add it in. I won't be translating to LUA, however if someone want's to go ahead. If someone uses this in their game, a credit mention would be nice =); Before you say it's not working! Check the paths of the files and code and in your project and make sure they match. v0.2 - Widgets Added - Border, Button, Group, Image, Label, Quad, SingleImageButton, Widget, Window. v0.2 (5th April) - CheckBox and images. - Cleaned up the demo window a little. - With the latest build of LE3 Left mouse click should be working although not tested as of yet. v0.3 (8th April) - Added Radio Group - Added Radio Button Widget - Added Radio Button Images - Modified Check box Image - Cleaning up of classes and formatting - Added Radio button Example v0.4- current (22nd September) - Added LineTextBox with switch for new line. Features include optional centre alignment new line switch. See example for usage. - Changed function some names in base Widget class. Instead of SetWidgetAlpha(num) it's now SetAlpha(num) SetPosX etc. (NOTE most have been done but not all yet) - Fixed a bug in the ImageBox class. - Added LineTextBox to example - Removed modifierFlags from widget class. They are now merged with SetWidgetFlags(). I did this because I found it confusing by somtimes passing setWidgetFlags into setWidgetModifierFlags and visa versa. It saves on a long variable declared for each widget. - Instead of each button radio button etc loading their own click sound, a sound is declared and released in the interface manager so widgets just need to call TheInterface->clickSound->Play(); - Other optimisations that I can't remember as I did them a while ago. v0.5 - current (23nd September) - Added Progress Bar. - Added Progress Bar to example. - Fixed issues for values not applying to children - More renaming Bugs - Color is spelt colour (The Australian way). I'll change it to color. Roadmap - Image button (separate image for 3 states). These widgets have been coded already, they just need LE3 testing window zorder, window dragging. - Remove need to load textures for standard widgets. Instead use 1 main texture palette. - Add constructors for all widgets that use fonts and sounds to be able to pass a font and sound as a parameter. I won't need to include "Interface.h" in those objects and makes them more customisable. Download Project v0.5 (22nd September) Hope to cut down some of your development time so hope you enjoy! 5 Quote Link to comment Share on other sites More sharing options...
cassius Posted March 29, 2013 Share Posted March 29, 2013 Thanks. Can it still be used with le2? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
tjheldna Posted March 29, 2013 Author Share Posted March 29, 2013 It wont work with LE2 as a few function names have changed, nothing too big though if you want to give it a try. I have LE 2 code for this however it hasn't received the latest updates. I can do this, but I'll need time. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 29, 2013 Share Posted March 29, 2013 nice work Tim, I will have a look at this. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted April 5, 2013 Author Share Posted April 5, 2013 Updated.... added checkbox Quote Link to comment Share on other sites More sharing options...
tjheldna Posted April 8, 2013 Author Share Posted April 8, 2013 Updated... - Added Radio Group. For a set radio buttons to work they must be added as a child to a radio group. - Added Radio Button Widget - Added Radio Button Images - Modified Check box Image - Cleaning up of classes and formatting - Added Radio button Example The source and data downloads are removed and replaced with a whole LE3 project. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted April 8, 2013 Share Posted April 8, 2013 Nice work Tim, may I suggest putting this in the asset browser. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted April 11, 2013 Author Share Posted April 11, 2013 Yes, I have never added anything in there before. I'll do it for the next update. Also a quick callout for some help on this. I haven't done any research on how to do this, but someone may be able to point me in the right direction and save me some time. I want to have 1 texture for the entire GUI system to skin the elements by cropping sections. This would be great if the user can just replace the images to skin their GUI. Does anyone have an example on how to do the texture cropping to make my life a little easier? Quote Link to comment Share on other sites More sharing options...
Josh Posted April 11, 2013 Share Posted April 11, 2013 I'd love to see some screenshots. 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...
tjheldna Posted September 22, 2013 Author Share Posted September 22, 2013 Hi All I've uploaded all changes I've made to my GUI system today as it can be used for the Penguin competition. I have made many changes since my last update and would be unfair if I didn't post my current version as I plan to use it! If you are using the previous versions in your project there are quite a few changes. Mainly the word "widget" is removed from things like SetWidgetPosX etc. With time being the big constraint with the Machine for Penguins comp this will really get a quick GUI on your screen.This is also a very flexible system as you can create your own widgets from a mixture of others Look at the Button widget for example its made up of a Quad, Border and Label. Hope you can get some use out of it as I have! Enjoy! 2 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 22, 2013 Share Posted September 22, 2013 Sweet work Tim. I will surely add this to my C++ projects. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted September 22, 2013 Author Share Posted September 22, 2013 Thanks! Also any feedback optimisations etc are also appreciated. Next on the cards is a progress bar, which is done and I think it's in the project already, but It's not used in the demo. And FYI there are a few functions that aren't working as the widget is not applying to the children (Hide Show and ModifierTime). I've fixed them I just need to upload. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted September 23, 2013 Author Share Posted September 23, 2013 Just uploaded the latest version. Progress Bar added with flags for vertical or default horizontal movement, and many important fixes. 1 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.