I got an idea, but I got no idea on how to make it.
Okay, so here is the deal.

I want a container which can contain certain objects (These objects will draw the sprites/graphics).
But because of different screen sizes, I want to be able to scale the containers width and height. But I do not want the objects in the container, that go outside of the container, because of the scaling to be visible.

Because I want the objects all to be positioned horizontaly to eachother and I want a horizontal sliderbar, so I can slide from left to right within the container.

I wonder if anyone could point me in the right direction.

Thanks in Advance,


1 Answer 1


What you are asking for sounds like "basic" window / UI functionality to me. Now I wrapped the word basic in quotes because while its a standard feature of many UI libraries and development platforms, I have never had to develop this myself and I personally wouldn't know where to begin without looking at some reference code. Also, many people will tell you to avoid writing GUI libraries of your own at all costs to avoid headaches and to save yourself lots of time.

That being said, there are XNA UI libraries out there that you should be able to utilize or, at the very least, be able to look at some source code from so that you can get some ideas as far as how to roll your own UI control that you are describing in your question.

I did a quick search on XNA UI libraries and I think the following two could be of use to you:

NeoforceControls - Looks like a very complete framework but could be hard to dig through if you are looking to use it as just a code reference especially considering reviewers claims of a lack of documentation. This could be good to use as a complete UI framework for your game or as a learning tool for more advanced UI features.

Ruminate MonoGame GUI (formerly XNAGui)- Looks like its much simpler than the one above so you may not be able to use it in its entirety for your game but it looks like it has some scrolling windows / containers that you could look at some code as a reference. I imagine this code is going to be much more straightforward than neoforce if you plan on creating your own control.

  • \$\begingroup\$ This really looks interesting. I think this will be very usefull. Thanks! \$\endgroup\$
    – DijkeMark
    Commented Nov 16, 2012 at 8:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .