|
-
Aug 30th, 2005, 07:13 AM
#1
Thread Starter
New Member
DrawString problem.
I'm writing a small game using GDI+ and I'm using the DrawString method of the Graphics object to write letters to a bitmap, one by one, in order to give the impression of a string being displayed letter at a time.
The gist of it is:
Code:
// Sentence to be drawn.
string strText = NPC.Name + ": " + NPC.GetDialogElement(DialogCounter);
// Split the sentence into letters.
char[] CharacterArray = strText.ToCharArray()
string strBuildingString = "";
foreach (char Character in CharacterArray)
{
strBuildingString += Character.ToString();
GFX.DrawString(BuildingString,fntFont,beigeBrush,130,413);
Form.Invalidate()
}
The problem is that after about 20 to 30 characters being printed, the DrawString method appears to start drawing the string with a greater space between each letter. After about 50 characters, it goes back to normal spacing. I have no idea what's causing this. I assume it's to do with the framework, rather than my own code because I can't see anything wrong with my own.
Thanks for your help!
-
Sep 2nd, 2005, 03:55 PM
#2
Sleep mode
Re: DrawString problem.
Try to draw the same letter over 20 or 30 and see if it produce the same result. also try using another font .
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
|