-
October 13th, 2012, 04:31 AM
#1
Making a "list box"
I want to make something like this for a game:
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).
-
October 16th, 2012, 01:57 AM
#2
Re: Making a "list box"
It all depends on what renderer you are using for your graphics.
Are you using plain OpenGL?
Are you using some game framework?
-
October 16th, 2012, 03:20 AM
#3
Re: Making a "list box"
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?
-
October 16th, 2012, 03:45 AM
#4
Re: Making a "list box"
Originally Posted by krs0
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.
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
Last edited by Paul McKenzie; October 16th, 2012 at 03:47 AM.
-
October 16th, 2012, 04:04 AM
#5
Re: Making a "list box"
The concepts are familiar to me. The problem I have is putting them into practice .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|