A little help please with GUI

Started by
2 comments, last by Telastyn 16 years, 8 months ago
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.
Advertisement
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.
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.
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.

This topic is closed to new replies.

Advertisement