If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Text in an Animated Box!

Hi, I'm trying to create a program that zooms a green box (from small to large) around a string of text. It starts in the center, then spreads to create a rectangle. It's a pretty simple applet, but since drawRect creates a 1-pixel border, I wanted it thicker. So instead, I used arrays to draw multiple boxes around the text to make the appearance thicker (by pixels). But this applet does not work, it creates one green box that is slightly off-center, and then creates a green dot starting from the middle, then traveling to the left corner of the applet. If someone can read this code, I'll be thankful. It will take a genius to sort my code disorganization (sorry, haste.)

The boxes must start out in the coordinates: first box is the very outer box in start position, to the last box, which is the very inner. This sequence must be kept even at the end of its expanding of the width/height. Please try this out, for it is a big help.

With best regards,
Ben

P.S. Don't waste too much time on this if you're getting nowhere. Thanks!

Instead of doing arrays, why not just draw two rectangles, one for the outline, and one the same as the background color, then draw the text over it. So it appears that you're drawing a border, when you're really just drawing a green rectangle, with some of it covered by a black rectangle.