mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
Merge pull request #1166 from DokaDoka/legacy
fix(legacy/Text3D): Remove formatting characters from length calc
This commit is contained in:
@@ -714,7 +714,8 @@ ESX.Game.Utils.DrawText3D = function(coords, text, scale, font)
|
||||
SetDrawOrigin(vector.xyz, 0)
|
||||
DrawText(0.0, 0.0)
|
||||
local scaleFactor = scale / 0.35
|
||||
DrawRect(0.0, 0.0 + 0.0111 * scaleFactor, 0.017 + (string.len(text) / 370) * scaleFactor, 0.03 * scaleFactor, 0, 0, 0, 75)
|
||||
local length = string.len(string.gsub(text, "(~[rbgypcmuosh]~)", ""))
|
||||
DrawRect(0.0, 0.0 + 0.0111 * scaleFactor, 0.027 + (length / 370) * scaleFactor, 0.03 * scaleFactor, 0, 0, 0, 75)
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user