CreateText3D: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|CreateText3D(text, size, x, y, z, rx, ry, rz)}} {{FuncParameters}} {{FuncParam|text|__EDIT_ME__}}..." |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Creates a 3d text (hologram) which always faces the player camera, only visible from certain range}} | ||
{{FuncSyntax|CreateText3D(text, size, x, y, z, rx, ry, rz)}} | {{FuncSyntax|CreateText3D(text, size, x, y, z [, rx, ry, rz])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|text| | {{FuncParam|text|Text you want to show}} | ||
{{FuncParam|size| | {{FuncParam|size|Size of the text}} | ||
{{FuncParam|x| | {{FuncParam|x|X position}} | ||
{{FuncParam|y| | {{FuncParam|y|Y position}} | ||
{{FuncParam|z| | {{FuncParam|z|Z position}} | ||
{{ | {{FuncParamOptional|rx|X rotation}} | ||
{{ | {{FuncParamOptional|ry|Y rotation}} | ||
{{ | {{FuncParamOptional|rz|Z rotation}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the text 3D identifier.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function OnPackageStart() | |||
local i = 1 | |||
for _ in pairs(Shops) do | |||
Shops[i].npc = CreateNPC(Shops[i].npc_model, Shops[i].x, Shops[i].y, Shops[i].z, Shops[i].h) | |||
SetNPCAnimation(Shops[i].npc, "CROSSARMS", true) | |||
SetNPCHealth(Shops[i].npc, 999999999) | |||
CreateText3D(Shops[i].name, 17, Shops[i].x, Shops[i].y, Shops[i].z + 130, 0,0,0) | |||
i = i + 1 | |||
end | |||
end | |||
AddEvent("OnPackageStart", OnPackageStart) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Text3DFunctions}} |
Latest revision as of 13:50, 12 November 2021
Description
Creates a 3d text (hologram) which always faces the player camera, only visible from certain range
Syntax
CreateText3D(text, size, x, y, z [, rx, ry, rz])
Parameters
- text
Text you want to show - size
Size of the text - x
X position - y
Y position - z
Z position - rx (optional)
X rotation - ry (optional)
Y rotation - rz (optional)
Z rotation
Return Value
- Returns the text 3D identifier.
Example
function OnPackageStart()
local i = 1
for _ in pairs(Shops) do
Shops[i].npc = CreateNPC(Shops[i].npc_model, Shops[i].x, Shops[i].y, Shops[i].z, Shops[i].h)
SetNPCAnimation(Shops[i].npc, "CROSSARMS", true)
SetNPCHealth(Shops[i].npc, 999999999)
CreateText3D(Shops[i].name, 17, Shops[i].x, Shops[i].y, Shops[i].z + 130, 0,0,0)
i = i + 1
end
end
AddEvent("OnPackageStart", OnPackageStart)
See also
- GetText3DCount
- GetAllText3D
- CreateText3D
- DestroyText3D
- IsValidText3D
- SetText3DAttached
- SetText3DDetached
- SetText3DDimension
- GetText3DDimension
- SetText3DPropertyValue
- GetText3DPropertyValue
- SetText3DText
- GetText3DText
- SetText3DLocation
- GetText3DLocation
- IsText3DStreamedIn
- GetStreamedText3D
- GetText3DActor