text: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "\|x([0-9]) *= * <code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(72 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|TEXT]]
{{RV|type=command
[[Category:Scripting Commands ArmA|TEXT]]


|game1= arma1
|version1= 1.00


|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


<h2 style="color:#000066">''' text ''text'''''</h2>
|game4= tkoh
|version4= 1.00


|game5= arma3
|version5= 0.50


'''Operand types:'''
|gr1= Locations


text: [[String]]
|gr2= Strings


'''Type of returned value:'''
|gr3= Structured Text


[[Nothing]]
|descr= Creates a structured text containing the given plain text if argument is [[String]]. Use [[setAttributes]] to set additional [[Structured_Text#Attributes | attributes]] on the text. If the argument is [[location]], returns location's text value (see Alt Syntax).


'''Compatibility:'''
|s1= [[text]] string


Version 2.01 required.
|p1= string: [[String]]


'''Description:'''
|r1= [[Structured Text]]


Creates a structured text containing the given plain text.
|s2= [[text]] location


|p21= location: [[Location]]


'''Example:'''
|r2= [[String]]


txt2 = '''text''' "Hello world."
|x1= <sqf>_stxt2 = text "Hello world.";</sqf>
 
|x2= <sqf>_townName = text myTownLocation;</sqf>
 
|x3= <sqf>_loc = text nearestLocation [position player, "NameMarine"]; //"Marina Bay"</sqf>
 
|seealso= [[parseText]] [[composeText]] [[image]] [[lineBreak]] [[setText]] [[createLocation]] [[deleteLocation]] [[drawLocation]] [[locationPosition]] [[locationNull]] [[nearestLocation]] [[nearestLocations]] [[nearestLocationWithDubbing]] [[name]]
}}

Latest revision as of 10:38, 13 May 2022

Hover & click on the images for description

Description

Description:
Creates a structured text containing the given plain text if argument is String. Use setAttributes to set additional attributes on the text. If the argument is location, returns location's text value (see Alt Syntax).
Groups:
LocationsStringsStructured Text

Syntax

Syntax:
text string
Parameters:
string: String
Return Value:
Structured Text

Alternative Syntax

Syntax:
text location
Parameters:
location: Location
Return Value:
String

Examples

Example 1:
_stxt2 = text "Hello world.";
Example 2:
_townName = text myTownLocation;
Example 3:
_loc = text nearestLocation [position player, "NameMarine"]; //"Marina Bay"

Additional Information

See also:
parseText composeText image lineBreak setText createLocation deleteLocation drawLocation locationPosition locationNull nearestLocation nearestLocations nearestLocationWithDubbing name

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note