|
  
|
|
|
#1 (permalink) |
|
Experienced Zuner
Join Date: Aug 2008
Posts: 168
Reputation: 20
|
How do I make a word wrap that detects when the text would run off the screen, and put an enter?
Here is the formula I have: [code]if fontsize<18 { amountofcharactersthatwillfitonthescreen = 18 + (18-fontsize) } else { amountofcharactersthatwillfitonthescreen = 18 + (fontsize - 18) } I don't know if that formula will work, and what the character that represents " " is. (I know it's not technically a formula).
__________________
Sign up for ZuneApps To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Web Browser looks like it might work To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Helpful Codes for Beginners To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Helpful Tutorials for Beginners To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#2 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
|
That doesn't make even the SLIGHTEST amount of sense. Heres something I wrote right here, i haven't compiled it, but it looks gud.
Code:
public static WordWrap(String text, Spritefont font, Rectangle screen)
{
//Seperate string to words
string[] words = text.Split(' ');
//Keep track of how much x space it needs
int tempX = 0;
//Return string
string ret = string.Empty;
//Add first word automatically
ret += words[0];
//Go through other words
for (int i = 1; i < words.Length; i++)
{
Vector2D size = font.MeasureString(text);
if ((size.X + tempX) < Rectangle.Width)
{
ret += " " + words[i];
tempX += size.X;
}
else
{
//Reset tempX
tempX = 0;
//Add new line and word
ret += "rn" + words[i];
}
}
return ret;
}
Zuneapps...Can you let me know if this helped you. Im not a fan of the OP topic abandoning
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by Netrix : 09-18-2008 at 07:15 AM. ![]() |
|
|
|
|
#3 (permalink) |
|
Purger of Ignorance
zB Programmer
Section Staff Super Zuner Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
|
That looks like it may work. That is very similar to what is in the Book Reader for word wrapping.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter Solitaire for your Zune! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Zune Book Reader! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#4 (permalink) | ||
|
God of the Post Reports
Support Team
Section Staff Super Zuner² |
Quote:
"Silly ZuneApps, multiple accounts are for kids!"
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Now with links! Quote:
![]() |
||
|
|
|
|
#5 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
|
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#6 (permalink) |
|
Experienced Zuner
Join Date: Aug 2008
Posts: 168
Reputation: 20
|
What is this? I only have this account. The other account is my brother's. Also, as you can see, my posting has never been disabled, so you should stop spreading rumors.
__________________
Sign up for ZuneApps To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Web Browser looks like it might work To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Helpful Codes for Beginners To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Helpful Tutorials for Beginners To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#7 (permalink) |
|
Purger of Ignorance
zB Programmer
Section Staff Super Zuner Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
|
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter Solitaire for your Zune! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Zune Book Reader! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#8 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
|
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#9 (permalink) |
|
Zewbie
Join Date: Sep 2008
Posts: 5
Reputation: 6
|
First of all, why was his posting abilities disabled? Second, he merged with me. Third, I have the program on my flash drive, and it's been having some problems, so I can't test it until it gets fixed.
__________________
Become a programmer; look at the bottom of my site: To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#10 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
|
Con-grad-ya-****ing-lations. This thread has useful code and it is now in the flame board because of you. Im gonanr epost it, DO NOT TOUCH THE THHREAD I AM MAKING FOR IT>
__________________
~Shutout5591~ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. If you like me work or I have helped you, + Rep me! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#12 (permalink) |
|
Purger of Ignorance
zB Programmer
Section Staff Super Zuner Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
|
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter Solitaire for your Zune! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Zune Book Reader! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
#19 (permalink) | |
|
God of the Post Reports
Support Team
Section Staff Super Zuner² |
I don't care usually-I just did myself in fact-but the mere fact that it's ZuneApps says that it probably shouldn't be brought back for anything but historical record.
![]()
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Now with links! Quote:
![]() |
|
|
|