SourceForge.net Logo Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact

View a Program

To run this program in JUDO, select the Program Code with your mouse, click the Edit menu of your browser and Copy. Then click in the code area of JUDO, click the Edit menu of JUDO and then Paste. Then Run the program.

Author Name:Edac Leinad
Program Name:getStringBounds
Program Description:Hello All,

I used some exsisting Java API and some include packages from JUDOBase to create this. If you will notice, I included several lines directly from JUDOBase.java.

This program gets the width of a String drawn in JUDO. Plug in the String, if it is bold and italic, and the size, and it will return a class called Rectangle2D. Use getWidth() to extract the width from the rectangle. You can use this width to center text, as I did here, or many other things, including buttons, and collisions.

I hope you are able to use this! Please give credit to Edac Leinad if you do.

I will be using this in an upcoming game that will hopefully be released before the end of this week.

For the code below, copy and paste it into JUDO, and move your mouse from left to right.

Have fun,

Edac Leinad
 
Program Type:Graphics
Program Code:

Last Modified Sun Dec 22 07:25:00 UTC 2013
Thomas Dunn

Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact