home *** CD-ROM | disk | FTP | other *** search
/ 3D World 153 / 3DW_153.iso / mac / Interface / POPUP.dir / 00004_Script_ouid < prev    next >
Text File  |  2009-03-18  |  943b  |  41 lines

  1. on loadTextFile aPath
  2.   t = getNetText( aPath )
  3.   if netDone( t ) then
  4.     txt = netTextResult( t )
  5.     member("popup_title").text = txt.line[1]
  6.     member("popup_info").text = txt.line[2..txt.line.count]
  7.     parseFormatInfo( member("popup_info") )
  8.     sprite(2).pFormat()
  9.   end if
  10. end
  11.  
  12.  
  13. on parseFormatInfo aTxt
  14.   greenStart = 0
  15.   i = 1
  16.   --put "formatting: " & aTxt
  17.   
  18.   
  19.   aTxt.fontSize = 14
  20.   aTxt.antialias = true
  21.   aTxt.antialiasthreshold = 1
  22.   aTxt.font = "WeddingSans Medium *"
  23.   aTxt.color = rgb(0,0,0)
  24.   
  25.   repeat while i <= aTxt.char.count
  26.     if aTxt.char[i] = "<" then
  27.       greenStart = i
  28.     end if
  29.     
  30.     if aTxt.char[i] = ">" then
  31.       if greenStart > 0 then
  32.         
  33.         aTxt.char[ greenStart..i ].color = rgb( 255, 255, 255 )
  34.         aTxt.char[ greenStart ].delete()
  35.         aTxt.char[ i-1 ].delete()
  36.         greenStart = 0
  37.       end if
  38.     end if
  39.     i = i + 1
  40.   end repeat
  41. end