I want to make something like this for a game:
Attachment 30509
It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.
Needs to run crossplatform (windows, linux).
Printable View
I want to make something like this for a game:
Attachment 30509
It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.
Needs to run crossplatform (windows, linux).
It all depends on what renderer you are using for your graphics.
Are you using plain OpenGL?
Are you using some game framework?
I am using SDL.
Was thinking to make a stl::list with all possible entries and display only a part of them. When I click one of the scroll buttons I make the corresponding edge element "invisible" and add the next one to the list.
Any other ways? Any libraries already made?
First, the data structure you use to store the elements should have little, if anything to do with how you want to display the elements. Whether it is a list, map, vector, or what have you, it shouldn't be tightly coupled with the UI. Otherwise you have business logic intertwined with display logic, and that type of design is hard to maintain and update.
Before deciding on what UI library to use, please read up on the Model-View-Controller design pattern.
http://en.wikipedia.org/wiki/Model-view-controller
Regards,
Paul McKenzie
The concepts are familiar to me. The problem I have is putting them into practice :D.