// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Inspect a component’s floating-label footprint // Not compiled or tested in-world // Setup: Put in a spare owned prim or linkset root. Touch the face or component to inspect. Child scripts may consume touches; face-based tools require a viewer that supplies touched-face data. // Stop / restore: Remove/disable. Inspectors read state and report only to the owner; they do not change the build. // Notes: Byte count uses Base64 length to measure UTF8 bytes. It does not assess visual line wrapping or viewer clipping. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Owner-only live inspection. default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer link=llDetectedLinkNumber(0); if(link==0)link=LINK_THIS; integer face=llDetectedTouchFace(0); list data=llGetLinkPrimitiveParams(link,[PRIM_TEXT]); string label=llList2String(data,0); integer lines=0; if(label!="")lines=llGetListLength(llParseStringKeepNulls(label,[" "],[])); string encoded=llStringToBase64(label); integer length=llStringLength(encoded); integer padding; if(length>0&&llGetSubString(encoded,-1,-1)=="=")++padding; if(length>1&&llGetSubString(encoded,-2,-2)=="=")++padding; integer bytes=length*3/4-padding; llOwnerSay("Label characters="+(string)llStringLength(label)+" UTF8 bytes="+(string)bytes+" explicit lines="+(string)lines+" opacity="+(string)llList2Float(data,2)); } }