Difference between revisions of "DCS func textToAll"

From DCS World Wiki - Hoggitworld.com
 
(4 intermediate revisions by the same user not shown)
Line 23: Line 23:
 
Id MUST be unique and is shared with the ids used with [[DCS_func_markToAll|mark panels]]. Likewise [[DCS_func_removeMark|trigger.action.removeMark]] is used to remove shapes created.  
 
Id MUST be unique and is shared with the ids used with [[DCS_func_markToAll|mark panels]]. Likewise [[DCS_func_removeMark|trigger.action.removeMark]] is used to remove shapes created.  
  
startPoint and endPoint MUST be a vec3 table. {x, y z}
+
point MUST be a vec3 table. {x, y z}
  
 
Color format is {r, g, b, a} with values 0 to 1. A red line with 50% alpha would be {1, 0, 0, 0.5}
 
Color format is {r, g, b, a} with values 0 to 1. A red line with 50% alpha would be {1, 0, 0, 0.5}
  
colorFill  
+
color defines the color of the text to be displayed
 +
 
 +
colorFill will be the color of a rectangle over the area that the text covers.
  
 
readOnly denotes whether in the future if clients will be allowed to edit or remove the shape.  
 
readOnly denotes whether in the future if clients will be allowed to edit or remove the shape.  
  
Message corresponds to an message box that will appear when the shape is added.  
+
text corresponds to the message that is displayed on the map.  
  
 
|rtnType= function
 
|rtnType= function
Line 55: Line 57:
 
|reqType5= table
 
|reqType5= table
  
|reqName5= color
+
|reqName5= fillColor
  
 
|reqType6= number
 
|reqType6= number
Line 69: Line 71:
  
  
|examples=  
+
|examples= The following will render a circle and text moved to be above the circle based on the position of a zone.
 +
 
 +
local ref = trigger.misc.getZone("targetArea")
 +
trigger.action.circleToAll(-1 , 1, ref.point , ref.radius , {0, 0, 0, 0} , {1, 0, 0, .7} , 0 , true)
 +
local msg = "Some 20 year old static object"
 +
local offset = {x = ref.point.x + ref.point.radius + 50, y = 0, z = ref.point.z - ((string.len(msg)/2)}
 +
trigger.action.textToAll(-1 , 2 , offset  , {1, 1, 1, .7} , {0, 0, 0, 0} , 20, true , msg )
 
|related=  
 
|related=  
 
[[DCS_singleton_trigger|'''Trigger Functions:''']] {{ListOfTriggerFuncs}}
 
[[DCS_singleton_trigger|'''Trigger Functions:''']] {{ListOfTriggerFuncs}}
|notes= In 2.5.6 THIS WILL CRASH CLIENTS WHO OPEN THE MAP VIEW.
+
|notes=
 
 
*Should be fixed in 2.7 though.
 
In Single Player without an aircraft selected you can see objects assigned to display for coalitionId 0. In multiplayer only shapes assigned to id -1 and your coalition will be visible.
 
 
}}
 
}}
 
[[Category:Singleton Functions|textToAll]]
 
[[Category:Singleton Functions|textToAll]]
 +
[[Category:Game Patch 2.5.5|textToAll]]

Latest revision as of 22:07, 22 July 2022

Scripting Root

Envrioment: Mission Scripting
Function: textToAll Added with: 2.5.5
Member Of: trigger.action
Syntax: function trigger.action.textToAll(number coalition , number id , vec3 point , table color , table fillColor , number fontSize , boolean readOnly , string text )
Description: Creates a text imposed on the map at a given point. Text scales with the map.

Coalition Ids to be used.

 -1 All
  0 Neutral
  1 Red
  2 Blue

Id MUST be unique and is shared with the ids used with mark panels. Likewise trigger.action.removeMark is used to remove shapes created.

point MUST be a vec3 table. {x, y z}

Color format is {r, g, b, a} with values 0 to 1. A red line with 50% alpha would be {1, 0, 0, 0.5}

color defines the color of the text to be displayed

colorFill will be the color of a rectangle over the area that the text covers.

readOnly denotes whether in the future if clients will be allowed to edit or remove the shape.

text corresponds to the message that is displayed on the map.


Return Value: function
Return Example: none
Examples: The following will render a circle and text moved to be above the circle based on the position of a zone.
local ref = trigger.misc.getZone("targetArea")
trigger.action.circleToAll(-1 , 1, ref.point , ref.radius , {0, 0, 0, 0} , {1, 0, 0, .7} , 0 , true)
local msg = "Some 20 year old static object"
local offset = {x = ref.point.x + ref.point.radius + 50, y = 0, z = ref.point.z - ((string.len(msg)/2)} 
trigger.action.textToAll(-1 , 2 , offset  , {1, 1, 1, .7} , {0, 0, 0, 0} , 20, true , msg )
Related Functions: Trigger Functions: ctfColorTag, getUserFlag, setUserFlag, getZone, explosion, smoke, effectSmokeBig, effectSmokeStop, illuminationBomb, signalFlare, radioTransmission, stopRadioTransmission, setUnitInternalCargo

outSound, outSoundForCoalition, outSoundForCountry, outSoundForGroup, outSoundForUnit, outText, outTextForCoalition, outTextForCountry, outTextForGroup, outTextForUnit

addOtherCommand, removeOtherCommand, addOtherCommandForCoalition, removeOtherCommandForCoalition, addOtherCommandForGroup, removeOtherCommandForGroup

markToAll, markToCoalition, markToGroup, removeMark, markupToAll, lineToAll, circleToAll, rectToAll, quadToAll, textToAll, arrowToAll, setMarkupRadius, setMarkupText, setMarkupFontSize, setMarkupColor, setMarkupColorFill, setMarkupTypeLine, setMarkupPositionEnd, setMarkupPositionStart

setAITask, pushAITask, activateGroup, deactivateGroup, setGroupAIOn, setGroupAIOff, groupStopMoving, groupContinueMoving

Notes: