George Clingerman

      XNADevelopment.com
posts - 152, comments - 486, trackbacks - 181

My Links

News



Tag Cloud

Article Categories

Archives

Post Categories

. XNADevelopment.com .

XNADevelopment.com - It's a Control Thing!

ItsAControlThing I've been playing with a lot of different projects lately trying to work on adding more polish to them. One of the things that I've been trying to do is add in controller images (provided by Microsoft off the Creator's website) when appropriate. So instead of just saying, "Press X to jump!", I stick the X button image into the line of text to pretty it up a little.

Well, that was getting old quick because I was having to do so much manual work lining it all up. Basically, I would have to draw the text, "Press", then I would have to draw an image for the "X" and then I would have to manually position and draw the rest of the text, "to jump!".

So I did what any programmer does when they get tired of doing something over and over again. I wrote something to do that all for me. "It's a Control Thing!" is some new sample code I released on XNADevelopment.com to do just that. No more manual positioning for me. Now I can just write some text like this, "Use the [LTRIGGER] to cycle through your items." and [LTRIGGER] will get automatically replaced by the controller image for the left trigger.

Sigh, life is good.

So if you want to take a peek or improve upon my idea, go for it! The source code is there for you to download, tweak and improve upon. Or if you're content with the way it is, just start using it in your projects like I am mine.

Enjoy and as always, let me know what you think. And please, if you make some cool improvements share them!

Technorati Tags:

Print | posted on Saturday, September 27, 2008 9:52 PM | Filed Under [ XNA Development XNA ]

Feedback

Gravatar

# re: XNADevelopment.com - It's a Control Thing!

I haven't checked it out, but I share your frustration totally.

I wrote something else to solve the same problem a few months ago. Intending to share it with the community sometime too.

My one took a slightly different approach similar to string.Format style.
e.g. DoFunkyStuff("
Press {0} to shoot", ">")

I reckon that, and another useful class I wrote for laying out stuff is the ONLY reason I managed to finish in time for Dream Build Play. Seriously.
9/28/2008 1:49 PM | Sharky
Gravatar

# re: XNADevelopment.com - It's a Control Thing!

Yup - I'm also another veteran of the painful ways to work around using controller glyphs & text wars.

Anyways, I'm looking forward to giving this a shot as well.

Thanks again George :)
10/8/2008 6:49 AM | RobC
Gravatar

# re: XNADevelopment.com - It's a Control Thing!

this does not work on the xbox 360 does anyone know how to fix this?

please e-mail me if you do
5/31/2009 8:16 PM | Daniel
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: