string sign_text; integer font_size = 30; list colors = [ <0.914, 0.906, 0.290>, // yellow <0.933, 0.369, 0.624>, // pink <0.961, 0.616, 0.725>, // violet <0.976, 0.647, 0.357> // tan ]; integer current_color; text_update() { string CommandList = ""; string current_line = ""; sign_text = llGetObjectDesc(); list sign_words = llParseString2List(sign_text,[" "],["."]); integer vertical_position = 20; integer word_count = llGetListLength(sign_words); CommandList = osMovePen( CommandList, 20, vertical_position ); CommandList += "FontSize " + (string)font_size + ";"; integer index; while (index < word_count) { if ( .75 * font_size * (llStringLength(current_line)+ llStringLength(llList2String(sign_words, index)))<250) { current_line += " " + llList2String(sign_words, index); } else { CommandList = osDrawText( CommandList, current_line ); vertical_position += (integer) (font_size * 1.5); CommandList = osMovePen( CommandList, 20, vertical_position ); current_line = llList2String(sign_words, index); } ++index; } CommandList = osDrawText( CommandList, current_line ); // Now write the text osSetDynamicTextureData( "", "vector", CommandList, "width:256,height:256", 0 ); } default { state_entry() { text_update(); } touch_end(integer total_number) { vector pos = llDetectedTouchST(0); if (pos.y<0.3) { font_size = font_size - 2; text_update(); } else if (pos.y>0.7) { font_size = font_size + 2; text_update(); } else { ++current_color; if (current_color >= llGetListLength(colors)) current_color = 0; llSetColor(llList2Vector(colors, current_color), ALL_SIDES); if (sign_text != llGetObjectDesc()) text_update(); } } }