Jump to content

GUI


xtreampb
 Share

Recommended Posts

Hey everyone i'm planning on starting to develop my GUI for my game and I'm not sure where to start. Does anyone have any advice or can point me in the proper direction?

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

You should develop a gui around a game (not otherwise), so start with basics:

 

- draw a rectangle as window border

- draw a rectangle with a centered text as button etc.

 

Just start small and extend it, you cant create the perfect gui (or anyother module) without experience in using it in a game / editor.

Link to comment
Share on other sites

i have the game component and i want to add the GUI component or start on the development. I know how i want it to look. This GUI is going to frame the top and the right edge of the game window. I'm asking what would be a good practice for creating and displaying the GUI.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

i'm trying to go for like age of empires how it has a GUI at the bottom of the screen and the top. I'm trying to go for like an overlay layer. How would i go about making an overlay layer for my GUI.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

I think you dont understand what we mean... you talk about your gui style, we talk about technique / features.

 

A gui can look like a Age of Empire / Command & Conquer / Starcraft gui or like a windows gui... its just graphics/styles.

 

 

So you want to create a gui for a strategy game... ok but what features do you need ?

- Display a border (the menu background) ?

- Display buttons with/without text

- Display images (maybe even rendertargets (minimap?)) ?

- Listboxes ?

- Comboboxes ?

- Drag'n'Drop ?

- DataGrid ?

- TabControl / Tabbed Windows ?

 

I dont get what you mean by overlay... i would render the gui as last thing so its always in front.

Link to comment
Share on other sites

GUI is on the roadmap. I think that is a reason why most people won't be bothered with writing their own unless it fulfills their requirements for writing it themselves.

 

If you mean GUI layer just use a transparent image that gets drawn on top of the scene once the word rendering is done.

Link to comment
Share on other sites

I have done a system that works quite well and have done something similar to what you ask in one of my many projects as I am making a point and click adventure game. I am always working on it, and will expand the widgets down the track. It will probably be obsolete when the LE GUI comes out, but this will do in the meantime and works well.

 

http://www.leadwerks.com/werkspace/topic/6407-le3-c-tjui/page__hl__tjui

 

Cover the entire screen in the window and the windows HandleEvent function do a world pick on the kEventMouseLeftUp event at the mouse position, if it didn't hit a button that is.

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

  • 1 year later...

I have to admit that I'm not a hardcore Leadwerks developer, but I am an experienced developer, and now that I'm investigating it again I have to admit I've been a bit frustrated with information fragmentation, and this might not seem so apparent to those who are familiar with the layout of Leadwerks. Also, there's been a couple posts where there is a disconnect with solutions, as they relate to Lua and C/C++. In regard to a scripting solution, I've seen a great Youtube series on HUD development, which I think is a great basis for drawing. Next, I think it should be made more evident in documentation for scripting that Script.blah_blah is just the tip of the ice burg and that the real scripting API is based off of the objects in the Command Reference section of the Leadwerks site. From there, we're left to do some educated attempts at implementing the syntax at the proper location, with the correct syntax. Also, from scripting edition of Leadwerks, the only way get a feel for the architecture is to create a blank project and examine the project's directory structure. There are many styles which can affect implementation, so basic GUI provisions don't solve the problem of a new user trying to understand the best place to draw, and understand what the even handling needs to affect. On a related topic, some one questioned the possibility of there being a book written, and i got the impression that the idea was blown off.

 

I realize I'm now getting a bit off topic, but the tutorials on the site are great for some real basic things, but they are not good for helping to promote Leadwerks to the new Indie developers that purchase it through Steam. I just don't think the information that exists will logically walk them through the architecture and help them investigate and evaluate GUI implementation techniques inside Leadwerks. Yes, we learn how to place a player into a game and its fantastic that it's interaction with the environment almost effortless. But, eventually the user is most likely going to need to learn the architecture so they can best script GUI/HUD logic, or customize current or additional functionality. The idea of creating a GUI manager, with hover and click events, is a time-tested logical approach, but there is no information that even hints toward some good approaches for scripting solutions in Leadwerks. A new developer will be discouraged, being frustrated with all the pieces of information that don't help them solve their problem, and simply quit trying, as powerful and helpful as Leadwerks is.

 

UPDATE: In support of Leadwerks 3.3 documentation, there is a "Lua" tab option when viewing the Command Reference documentation. But, when trying to create a new blank object script, my latest copy from Steam didn't give me the option to create a object script skeleton to fill in, so I used the documentation to create my own skeleton object script.

 

UPDATE: Script Creation Issue. Well, it turns out that the right click has to be in the bottom window, below the Assets hierarchy. I thought the right click was on the item you wanted to attach the script to ... oh brother!

Link to comment
Share on other sites

LE3 don't have GUI support officially and natively , but some implementations exists :

1) LE3 supports Neosis GUI that is the most complete and avanced but also more expensive.

2) You have for some 10 bucks, Agrror complete GUI solution, you can directly use in Lua and really easy.

 

 

There is solutions for you from super cheap to expensive , you see LE3 have good things not only users complaining

wink.png

 

I agree about GUI, theses ready to use solutions could be officially put somewhere in User Guide or pinned in Porgramming thread.

Stop toying and make games

Link to comment
Share on other sites

LE3 don't have GUI support officially and natively , but some implementations exists :

1) LE3 supports Neosis GUI that is the most complete and avanced but also more expensive.

2) You have for some 10 bucks, Agrror complete GUI solution, you can directly use in Lua and really easy.

 

 

There is solutions for you from super cheap to expensive , you see LE3 have good things not only users complaining

wink.png

 

I agree about GUI, theses ready to use solutions could be officially put somewhere in User Guide or pinned in Porgramming thread.

 

I thought I read that Agrror's solution was for C++ only, I didn't include associated Lua. Regardless, I do think if there was a bit more documentation on how the Leadwerks Game Engine architecture pieces fit together with Lua scripting, creating a custom GUI wouldn't be so bad. I'm familiar with Lua and general GUI logic, so I was able to invest some time and finally came up with some highlevel toolbar GUI handling logic in a script that can be attached to a Pivot object. It took me a few hours of hunting through the docs and an evening of coding (including some clean-up) to have a solid foundation to build some real come on. The only additional thing I'd like to do is set up callbacks so that their output can be attached to some kind of battle manager script that can send hit damage against the applicable enemies, based on toolbar options (spells, etc.) So, I'll have to study the aspect of identifying in and out points for the flow GUI. As a side note, if folks are stuck on GUI development, I imagine their just as baffled about saving and loading level data, which would be another major stumbling block for me, being new to Leadwerks.

Link to comment
Share on other sites

There is no roadmap at the moment and I don't believe GUI is currently planned. Part of the reason may be is that there are now "solutions" for both LUA and C out there.

 

I'll have to look around more to see what those options are and see what features they provide. Especially since I thought/think Agrror's solution was only C++ based.

Link to comment
Share on other sites

As a side note, if folks are stuck on GUI development, I imagine their just as baffled about saving and loading level data, which would be another major stumbling block for me, being new to Leadwerks

There is no blocking problem with GUI, two solutions ready to use exists. People just need to ask to community until it is pinned somewhere.

Why not making this actual topic pinned ?

 

Saving and loading data is pure Lua file read and write in LE3

http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/filesystem/

You can write files in Windows Users directory, i don't know for Linux.

And you can add some Lua library to encrypt or decrypt save data if you need , do some google.

 

There is no stopper with GUI or saving/loading data in LE3, the real stoppers are mone on some missing features sleep.png

Stop toying and make games

Link to comment
Share on other sites

My humble look on this with GUI's are that actually you don't need advanced feature's for most games. You will get away with some really simple things in most cases. Things that quite easily can be achieved with current Draw-functions. A Clickable Image (can be used as button or checkbox) and an input field (Text and number) will bring you a long way. I might do a C++ tutorial on that when I get time for that. My next C++ video will be about reading and writing data between LUA and C++, so a good example of that could be to make a simple GUI then.

  • Upvote 1

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Yes of course you are right gamecreator. I even bought the FlowGui although it has way more than I need. Its well worth supporting Aggrors good work. I recommend that. Its me being the C++ nerd I am that like to torture my self with the "Can do it my self" absurd thing. Not recommended :). I will probably never get a game done ;)

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

I am that like to torture my self with the "Can do it my self" absurd thing. Not recommended smile.png. I will probably never get a game done

I hope you will stop torturing yourself Roland, you should delegate tasks like UI to FlowGUI as it is more then you need, and showing you can do it like you said don't help making your game. I hope you not intend to proove you can code a complete 3D engine laugh.png

  • Upvote 1

Stop toying and make games

Link to comment
Share on other sites

 

I hope you will stop torturing yourself Roland, you should delegate tasks like UI to FlowGUI as it is more then you need, and showing you can do it like you said don't help making your game. I hope you not intend to proove you can code a complete 3D engine laugh.png

In facto I have done that once, but it sucked :). Anyway I'm not sure I even want to make a game. Its just so fun playing with these 3D toys

 

Roland Strålberg
Website: https://rstralberg.com

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...