{"name":"setAttributes","title":"setAttributes","type":"command","url":"https://community.bistudio.com/wiki/setAttributes","revid":351277,"updated":"2023-11-27T02:34:49Z","groups":["Strings","Structured Text"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"Returns a Structured Text created from the given structured text and sets attributes to the given values.\n\n> [!IMPORTANT]\n> Even though command accepts plain String too, the argument should be Structured Text in order for the set attributes to have an effect.\n> Additionally the result of the command should be fed to composeText (See Example 1) or formatText.","syntaxes":[{"syntax":"text setAttributes [name1, value1, name2, value2, ...]","params":[{"name":"text","type":"String or Structured Text","description":"only passing Structured Text has any effect","type_expr":"String | Structured Text"},{"name":"nameN","type":"String","description":"name of the attribute","type_expr":"String"},{"name":"valueN","type":"String","description":"value of the attribute","type_expr":"String"}],"returns":{"type":"Structured Text","type_expr":"Structured Text"},"form":"binary","left":{"text":"text"},"right":{"text":"[name1, value1, name2, value2, ...]"}}],"examples":[{"code":["_txt = text \"Red text, right align\";\n_txt setAttributes [\"color\", \"#FF0000\", \"align\", \"right\"];\nhint composeText [_txt];"]}],"see_also":["composeText","formatText","parseText","text","ctrlSetStructuredText"]}