Advertisement



Go Back   Zune Boards > Miscellaneous > The Archives

New Member?



 
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

The Archives Classic threads from more simple times.

 
 
LinkBack Thread Tools
Old 09-14-2008, 02:32 PM   #1 (permalink)
Experienced Zuner
 
Join Date: Aug 2008
Posts: 168
Reputation: 20
Awards Showcase
Best New Member 
Total Awards: 1
Default Word Wrap


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.




ZuneApps is offline  
Old 09-18-2008, 07:01 AM   #2 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
Default

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;
        }
Let me know if it works

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.




shutout5591 is offline  
Old 09-18-2008, 07:16 AM   #3 (permalink)
Purger of Ignorance
zB Programmer
Section Staff
Super Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
Send a message via MSN to Netrix
Awards Showcase
Favorite zB Extremity 
Total Awards: 1
Default

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.




Netrix is offline  
Old 09-18-2008, 07:20 AM   #4 (permalink)
God of the Post Reports
Support Team
Section Staff
Super Zuner²
 
Locke's Avatar
 
Join Date: May 2008
Location: In the kitchen, preparing a brand new batch of n00blets
Posts: 4,134
Reputation: 702
Send a message via MSN to Locke
Awards Showcase
Member of the Quarter Biggest staff suck-up Biggest Shouter 
Total Awards: 3
Default

Quote:
Originally Posted by shutout5591 View Post
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;
        }
Let me know if it works

Zuneapps...Can you let me know if this helped you.

Im not a fan of the OP topic abandoning
You'll be waiting for a while; his posting got disabled.

"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:
Originally Posted by stkr
But yes, please do try to stay on-topic, even if you are blowing up someone's head.




Locke is online now  
Old 09-18-2008, 08:00 AM   #5 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
Default

Quote:
Originally Posted by Locke View Post
You'll be waiting for a while; his posting got disabled.

"Silly ZuneApps, multiple accounts are for kids!"
Wow, really?? Damn. Multiple accounts are for nubs.
__________________
~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.




shutout5591 is offline  
Old 09-18-2008, 05:00 PM   #6 (permalink)
Experienced Zuner
 
Join Date: Aug 2008
Posts: 168
Reputation: 20
Awards Showcase
Best New Member 
Total Awards: 1
Default

Quote:
Originally Posted by Locke View Post
You'll be waiting for a while; his posting got disabled.

"Silly ZuneApps, multiple accounts are for kids!"
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.




ZuneApps is offline  
Old 09-18-2008, 05:27 PM   #7 (permalink)
Purger of Ignorance
zB Programmer
Section Staff
Super Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
Send a message via MSN to Netrix
Awards Showcase
Favorite zB Extremity 
Total Awards: 1
Default

Quote:
Originally Posted by ZuneApps View Post
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.
Actually, it was. I saw it myself. It was probably re-enabled before you logged in.
__________________
"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.




Netrix is offline  
Old 09-19-2008, 03:40 AM   #8 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
Default

Quote:
Originally Posted by Netrix View Post
Actually, it was. I saw it myself. It was probably re-enabled before you logged in.
I didn't want to start anything :P but, yea I saw it aswell.

Now that thats out of the way - ZuneApps, did the word wrap work?
__________________
~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.




shutout5591 is offline  
Old 09-26-2008, 04:23 PM   #9 (permalink)
Zewbie
 
Join Date: Sep 2008
Posts: 5
Reputation: 6
Default

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.




Zune Virus is offline  
Old 09-26-2008, 07:37 PM   #10 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 315
Reputation: 78
Default

Quote:
Originally Posted by Zune Virus View Post
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.
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.




shutout5591 is offline  
Old 10-24-2008, 03:29 AM   #11 (permalink)
Mod. Preview
Experienced Member
 
Join Date: Jun 2008
Posts: 810
Reputation: 287
Default

Seems like all threads created by zuneapps end up in the flameboard... Weird.



catnat109 is offline  
Old 10-24-2008, 04:11 AM   #12 (permalink)
Purger of Ignorance
zB Programmer
Section Staff
Super Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 1,674
Reputation: 250
Send a message via MSN to Netrix
Awards Showcase
Favorite zB Extremity 
Total Awards: 1
Default

Quote:
Originally Posted by catnat109 View Post
Seems like all threads created by zuneapps end up in the flameboard... Weird.
Noooo... We were all supposed to forget about him.
__________________
"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.




Netrix is offline  
Old 10-24-2008, 04:19 AM   #13 (permalink)
**** you
Administrator
Ultimate Zuner
 
Nurta's Avatar
 
Join Date: Jan 2007
Posts: 6,650
Reputation: 528
Send a message via AIM to Nurta Send a message via MSN to Nurta Send a message via Yahoo to Nurta Send a message via Skype™ to Nurta
Awards Showcase
Most Flamboyant Personality putis' Pet 
Total Awards: 2
Default

Quote:
Originally Posted by catnat109 View Post
Seems like all threads created by zuneapps end up in the flameboard... Weird.
nice bump.

Now go die
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



Nurta is offline  
Old 10-24-2008, 06:12 AM   #14 (permalink)
It's a trap!
GFX Crew
Graduate Zuner
 
Tobososlow's Avatar
 
Join Date: Nov 2007
Location: In a hypocritical world
Posts: 1,476
Reputation: 275
Default

Agreed.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Tobososlow is online now  
Old 10-24-2008, 07:38 AM   #15 (permalink)
Mod. Preview
Experienced Member
 
Join Date: Jun 2008
Posts: 810
Reputation: 287
Default

Who cares if I bump it's on the flame board.



catnat109 is offline  
Old 10-24-2008, 07:47 AM   #16 (permalink)
It's a trap!
GFX Crew
Graduate Zuner
 
Tobososlow's Avatar
 
Join Date: Nov 2007
Location: In a hypocritical world
Posts: 1,476
Reputation: 275
Default

It's been over a month it's just kind of pointless.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Tobososlow is online now  
Old 10-24-2008, 07:49 AM   #17 (permalink)
Mod. Preview
Experienced Member
 
Join Date: Jun 2008
Posts: 810
Reputation: 287
Default

So who cares...



catnat109 is offline  
Old 10-24-2008, 10:40 AM   #18 (permalink)
**** you
Administrator
Ultimate Zuner
 
Nurta's Avatar
 
Join Date: Jan 2007
Posts: 6,650
Reputation: 528
Send a message via AIM to Nurta Send a message via MSN to Nurta Send a message via Yahoo to Nurta Send a message via Skype™ to Nurta
Awards Showcase
Most Flamboyant Personality putis' Pet 
Total Awards: 2
Default

I do, tobo does, I think a lot of people do
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



Nurta is offline  
Old 10-24-2008, 10:48 AM   #19 (permalink)
God of the Post Reports
Support Team
Section Staff
Super Zuner²
 
Locke's Avatar
 
Join Date: May 2008
Location: In the kitchen, preparing a brand new batch of n00blets
Posts: 4,134
Reputation: 702
Send a message via MSN to Locke
Awards Showcase
Member of the Quarter Biggest staff suck-up Biggest Shouter 
Total Awards: 3
Default

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:
Originally Posted by stkr
But yes, please do try to stay on-topic, even if you are blowing up someone's head.




Locke is online now  
Old 10-24-2008, 02:09 PM   #20 (permalink)
Coast to Coast.
Support Team
Moderator
Expert Zuner
 
Space Toast's Avatar
 
Join Date: Aug 2007
Location: Next to Putis in Sexyland
Posts: 3,372
Reputation: 617
Send a message via AIM to Space Toast
Awards Showcase
Best avatar 
Total Awards: 1