Sign in to follow this  

A little help please with GUI

This topic is 3782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm trying to design a graphics engine for a game. I am having a hard time finding a way to design the GUI system. From what I've understood, the GUI has 2 parts: Input, and Graphical Ouput. Is this correct? Because I'm using the MVC pattern (for the whole game, not for the engine), this leads to the situation where the GUI system (which should be a seperated library I suppose) belongs to both the Controller and View, and this just seems incorrect. When user input arrives to the controller, it should handle the input. But only the View part of the program knows all the graphical interface. So when I click within the bounds of a button for example, only the View can determine that there was a click in that button, because only the View knows the graphical structure of the GUI. In other words, I can't find a way to not send user input into the View part of the GUI. I would really appreciate any clarification on this matter, It's quite confusing me. Thanks.

Share this post


Link to post
Share on other sites
Where's the model? You have the view which is the visual(/auditory) format of the UI, and the controller which is the input/options part of the UI, but where's the actual construction and orientation of the UI widgets? They shouldn't particularly care what their representation is.

Share this post


Link to post
Share on other sites
Ohh, so what you're saying is that the presentation of the UI should also be divided into 2 parts: one contained inside the Model, and the View taking the data from there and drawing it?
I thought that the Model should only have the data of the game itself (graphical objects, physical objects, etc..), without any connection to any data related to the graphics. So I thought that all the "UI widgets" should be inside the View part, shouldn't it?
I'm still a bit confused now. What parts exactly should be contained in the Model? thanks again for any help.

Share this post


Link to post
Share on other sites
You were just asking about UI, not the game :P Anyways I think you're being a bit too literal/white tower in your application of the pattern.

The UI itself will be seperate, yes? Then design it separately. It can follow it's own MVC pattern even if in the context of the game's MVC it only hits the V and C.

Share this post


Link to post
Share on other sites

This topic is 3782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this