Go Back   Zune Boards > Miscellaneous > The Archives

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: 236
GameStudio is an unknown quantity at this point
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).
__________________
GameStudio




GameStudio is offline  

Advertisement [Remove Advertisement]
Old 09-18-2008, 07:01 AM   #2 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
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~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!

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
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
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! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline  
Old 09-18-2008, 07:20 AM   #4 (permalink)
Zune Priest
 
Azu-nyan's Avatar
 
Join Date: May 2008
Location: Planet Bob
Posts: 7,088
Azu-nyan is a jewel in the roughAzu-nyan is a jewel in the rough
Send a message via MSN to Azu-nyan Send a message via Skype™ to Azu-nyan
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!"
__________________

o/ lolBeatrice \o
Quote:
Originally Posted by #sos-dan
21:42 <Azu-nyan>: And no, no happying. <.<
21:42 <Azu-nyan>: fapping*
21:42 <vonPreussen>: Freudian typos xD



Azu-nyan is offline  
Old 09-18-2008, 08:00 AM   #5 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
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~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!




shutout5591 is offline  
Old 09-18-2008, 05:00 PM   #6 (permalink)
Experienced Zuner
 
Join Date: Aug 2008
Posts: 236
GameStudio is an unknown quantity at this point
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.
__________________
GameStudio




GameStudio is offline  
Old 09-18-2008, 05:27 PM   #7 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
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! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline  
Old 09-19-2008, 03:40 AM   #8 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
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 but, yea I saw it aswell.

Now that thats out of the way - ZuneApps, did the word wrap work?
__________________
~Shutout5591~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!




shutout5591 is offline  
Old 09-26-2008, 04:23 PM   #9 (permalink)
Experienced Zuner
 
Join Date: Aug 2008
Posts: 236
GameStudio is an unknown quantity at this point
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.
__________________
GameStudio




GameStudio is offline  
Old 09-26-2008, 07:37 PM   #10 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
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~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!




shutout5591 is offline  
Old 10-24-2008, 03:29 AM   #11 (permalink)
catnat109
Guest
 
Posts: n/a
Default

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



 
Old 10-24-2008, 04:11 AM   #12 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
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! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline  
Old 10-24-2008, 04:19 AM   #13 (permalink)
God
α+ω
Retired Staff
Professional Spammer
 
Join Date: Jan 2007
Location: Look up
Posts: 7,803
God has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud of
Send a message via AIM to God Send a message via MSN to God Send a message via Yahoo to God Send a message via Skype™ to God
Awards Showcase
Biggest Abuser of Noobs Trogdor's Peasant Favorite zB Extremity 
Total Awards: 3
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
__________________
Quote:
Originally Posted by sb
10:15 PM <Marshillboy> I almost never eat out

Nurta.net cures 29 known diseases



God is offline  
Old 10-24-2008, 06:12 AM   #14 (permalink)
Super Zuner
 
Tobososlow's Avatar
 
Join Date: Nov 2007
Location: In a hypocritical world
Posts: 1,663
Tobososlow is a name known to allTobososlow is a name known to allTobososlow is a name known to allTobososlow is a name known to all
Default

Agreed.
__________________




Tobososlow is offline  
Old 10-24-2008, 07:38 AM   #15 (permalink)
catnat109
Guest
 
Posts: n/a
Default

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



 
Old 10-24-2008, 07:47 AM   #16 (permalink)
Super Zuner
 
Tobososlow's Avatar
 
Join Date: Nov 2007
Location: In a hypocritical world
Posts: 1,663
Tobososlow is a name known to allTobososlow is a name known to allTobososlow is a name known to allTobososlow is a name known to all
Default

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




Tobososlow is offline  
Old 10-24-2008, 07:49 AM   #17 (permalink)
catnat109
Guest
 
Posts: n/a
Default

So who cares...



 
Old 10-24-2008, 10:40 AM   #18 (permalink)
God
α+ω
Retired Staff
Professional Spammer
 
Join Date: Jan 2007
Location: Look up
Posts: 7,803
God has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud ofGod has much to be proud of
Send a message via AIM to God Send a message via MSN to God Send a message via Yahoo to God Send a message via Skype™ to God
Awards Showcase
Biggest Abuser of Noobs Trogdor's Peasant Favorite zB Extremity 
Total Awards: 3
Default

I do, tobo does, I think a lot of people do
__________________
Quote:
Originally Posted by sb
10:15 PM <Marshillboy> I almost never eat out

Nurta.net cures 29 known diseases



God is offline  
Old 10-24-2008, 10:48 AM   #19 (permalink)
Zune Priest
 
Azu-nyan's Avatar
 
Join Date: May 2008
Location: Planet Bob
Posts: 7,088
Azu-nyan is a jewel in the roughAzu-nyan is a jewel in the rough
Send a message via MSN to Azu-nyan Send a message via Skype™ to Azu-nyan
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.
__________________

o/ lolBeatrice \o
Quote:
Originally Posted by #sos-dan
21:42 <Azu-nyan>: And no, no happying. <.<
21:42 <Azu-nyan>: fapping*
21:42 <vonPreussen>: Freudian typos xD



Azu-nyan is offline  
Old 10-24-2008, 02:09 PM   #20 (permalink)
The Magicy Magic of Magic
Retired Staff
Super Zuner²
 
Space Toast's Avatar
 
Join Date: Aug 2007
Location: with Putis in Sexyland
Posts: 4,327
Space Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant futureSpace Toast has a brilliant future
Send a message via AIM to Space Toast
Default

Even the historical records should be burned.
and Agreed with Nurta.
Sad day.
__________________



putis.



Space Toast is offline  
 

Bookmarks

Thread Tools