Advertisement Jump to content
  • Advertisement
  • entries
  • comments
  • views


Sign in to follow this  


Making progress on my entry. Spent most of yesterday figuring out the changes between XNA beta and the new release.

Got my BitmapFont class converted from C++ to C#; works better and works right (found a nice little quirk in it.) Here's a screenshot:

(Just random test text.)

Shows vertical-center, center alignment, word-break, and color formatting. I changed the system a tiny bit from before. Now using ^0 resets the color to the color specified by the function call. Here's the code for the sample above:

TimeElapsed += (float)GameTime.ElapsedGameTime.Milliseconds / 1000.0f;
if(TimeElapsed > 1)
TimeElapsed = 0;

SpriteBatch.Draw(CursorTexture, new Rectangle((int)CursorPosition.X, (int)CursorPosition.Y, 32, 32), Color.White);

Font.Print(String.Format("Mouse XY({0},{1})", CursorPosition.X, CursorPosition.Y), 0, CursorPosition + new Vector2(32.0f, 32.0f), FontFormatting.Left, (int)Color.Red.PackedValue);

String[] Lines =
"`255,0,0`Delta Squad Leader^0: Alpha Squad, come in.",
"`0,0,255`???^0: I. y.. ..als?",
"`255,0,0`Delta Squad Leader^0: Message scrambled; repeat.",
"`0,0,255`???^0: I said, is that you Beals?",
"`255,0,0`Beals^0: About fucking time you assholes made it to high ground. What's your status?",
"`0,0,255`Alpha Squad Leader^0: We're in the `255,255,0`laboratory^0, making our way to the roof. We lost Seraph a couple floors down.",
"`255,0,0`Beals^0: Damnit. Keep moving, we'll try to go back down when we regroup.",

if(LineCount > Lines.Length)
LineCount = Lines.Length;

String Output = "";
for(int Index = 0; Index < LineCount; ++Index)
Output += Lines[Index] + "\n";

Mark2.Print(Output, 0, new Rectangle(0, 0, 800, 600), FontFormatting.WordBreak | FontFormatting.VCenter | FontFormatting.Center, (int)0xff808080);


You can't see it from the screenshot, so here's the gist of things:
Every second a new line of text is added
Escape exits
The cursor is controlled by the mouse or the 360 controller
Pressing back on the 360 controller exits

That's about it. More stuff will be coming though.

I have to say I absolutely love writing font engines (and other associated stuff like GUIs.)

Anyway, more stuff coming tomorrow. Oh, and thanks for 44k views and 978 posts; you guys rock!
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!