The Daily Click ::. Forums ::. Klik Coding Help ::. fit asb (or active) dimensions to text
 

Post Reply  Post Oekaki 
 

Posted By Message

SolarB



Registered
  26/12/2011
Points
  564
13th February, 2012 at 10:51:36 -

I want to set the dimensions of an active system box or active (used as a background) to the dimensions of a paragraph of text. When the next paragraph is displayed, the background should resize itself to the length and width of the text.

I've tried using an asb with dimensions set to len(string)/? but no luck when there are line breaks in the text.

Is this possible?

 
My Open Source Examples: http://bit.ly/YyUFUh

nim



Registered
  17/05/2002
Points
  7234
13th February, 2012 at 12:32:55 -

The Calculate Text Rect object will probably help you a lot with this.

http://www.starfishgames.co.uk/#ct

 
//

SolarB



Registered
  26/12/2011
Points
  564
16th February, 2012 at 11:15:25 -

Thanks nim, will give this a shot.

However I've also found another way - you can resise the ASB to the size of the string, but only if you change the string paragraph at the same time you set the text in the ASB. Go figure... primitive, but still no extension required.

 
My Open Source Examples: http://bit.ly/YyUFUh

nivram



Registered
  20/07/2006
Points
  171
16th February, 2012 at 17:17:29 -

Also, try the reverse. Re-size the text to fit a box when the text changes.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm
   

Post Reply



 



Advertisement

Worth A Click