Jump to content

LE3 C++ tjui


tjheldna
 Share

Recommended Posts

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!

  • Upvote 5
trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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.

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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?

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

  • 5 months later...

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!

  • Upvote 2
trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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.

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...