1 Reply Latest reply on Sep 6, 2006 10:13 AM by tedalde2

    Text overlays

    positdan
      I have a text overlay which is one line long. when I swap the cast member with another text that wraps to a second line, the text on two lines is squished to the same height as the orignal text.
      It looks like it is trying to fit the wrapped text into the same area as the orignal text. Any solution for this? Or am I loading the new text wrong? I use this code to replace the overlay text with a new text.


        • 1. Re: Text overlays
          tedalde2 Level 2
          You may want to create your texture from a "container" image object that is a power of 2, rather than creating it from a cast member with random dimensions. Look at imaging lingo...

          Measure the width and height of your text member after putting the new text into it. Then create an image who's dimensions are the next power of 2 larger than your text dimensions (ex. a 98 x 14 text member would need a 128 x 16 image). Then copypixels() the text member's image onto the container image, and create your texture from the container image using #fromImageObject.

          You can set the alpha of the image too, so the background of your text is transparent.