drawText
Definition
-- @/=[C]:-1
function drawText(...)
Callers
@/lua/vehicle/ai.lua
--obj.debugDrawProxy:drawSphere(1, tSi.pos, sColor)
--obj.debugDrawProxy:drawText(tSi.pos + vec3(0, 0, 1), color(0,0,0,255), tostring(tSi.turn))
debugDrawer:drawSphere(4, p, color(255,0,0,100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0,0,0,255), 'Destination')
end
local txt = thisPathLastNode.." -> "..strFormat("%0.4f", thisScore)
debugDrawer:drawText(mapData.positions[thisPathLastNode] + vec3(0, 0, 2), color(0, 0, 0, 255), txt)
end
debugDrawer:drawSphere(4, p, color(255, 0, 0, 100))
debugDrawer:drawText(p + vec3(0, 0, 4), color(0, 0, 0, 255), 'Destination')
end
debugDrawer:drawSphere(0.1, point.pos + vec3(0,0,speed*0.2), color(255,255,255,255))
debugDrawer:drawText(point.pos + vec3(0,0,speed*0.2), color(0, 0, 0, 255), strFormat("%2.0f", speed*3.6).." kph")
if j > 1 then
tmpVec1:set(0, 0, v[2] * 0.2)
debugDrawer:drawText(v[1] + tmpVec1 + zOffSet, yellow, strFormat("%2.0f", v[2]*3.6).." kph")
tmpVec1:set(0, 0, v[3] * 0.2)
debugDrawer:drawText(v[1] + tmpVec1 + zOffSet, blue, strFormat("%2.0f", v[3]*3.6).." kph")
end
debugDrawer:drawCylinder(prevPoint, p1, 0.05, red)
debugDrawer:drawText(p1, black, strFormat("%2.0f", speed*3.6).." kph")
prevSpeed = speed
debugDrawer:drawCylinder(prevPoint_, p1_, 0.05, green)
debugDrawer:drawText(p1_, black, strFormat("%2.0f", legalSpeed*3.6).." kph")
prevLegalSpeed = legalSpeed
-- debugDrawer:drawCylinder(p, p + vec3(0, 0, scaledV), 0.06, color(abs(min(sign(v),0))*255,max(sign(v),0)*255,0,200))
-- debugDrawer:drawText(p + vec3(0, 0, scaledV), color(0,0,0,255), strFormat("%5.4e", v))
-- debugDrawer:drawCylinder(prevPoint, p + vec3(0, 0, scaledV), 0.06, col)
debugDrawer:drawCylinder(prevPoint, p1, 0.05, col)
debugDrawer:drawText(p1, color(0,0,0,255), strFormat("%2.0f", v*3.6) .. " kph")
prevPoint = p1
@/lua/ge/extensions/util/decalRoadsEditor.lua
debugDrawer:drawSphere(n.pos, n.radius, ColorF(1,0,0, 0.1 * vis))
--debugDrawer:drawText(pp, String(tostring(nid)), ColorF(0,0,0,1))
if lastData then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua
local nodeText = node.name and string.format("Node: %d (%s)", nodeId, node.name) or tostring(nodeId)
debugDrawer:drawText(nodePos, nodeText, blackColor)
local triText = string.format("Triangle: %s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
debugDrawer:drawText(tempTriPos, triText, blackColor)
end
@/lua/ge/extensions/editor/aiViz.lua
if camNodeSqDist < square(clamp(editor.getPreference("gizmos.visualization.visualizationDrawDistance") * 0.5, 50, 250)) then
debugDrawer:drawText(n.pos, String(tostring(nid)), linkBaseColor)
end
@/lua/vehicle/extensions/scenario/annotate.lua
local p1 = obj:getPosition() + vec3(0, 0, 2)
obj.debugDrawProxy:drawText(p1, color(0,0,0,255), data.text)
obj.debugDrawProxy:drawLine(obj:getPosition(), p1, color(0, 0, 0, 255))
@/lua/ge/extensions/gameplay/util/crashDetection.lua
end
debugDrawer:drawText(frameDamageImpact.vehPos, string.format("%i", frameDamageImpact.newDamage), Black, false, false)
--debugDrawer:drawTextAdvanced(impact.vehPos, string.format("#%i | %i damage | %i kph | %0.2f s", impactIndex, impact.newDamage, impact.speed, impact.time), ColorF(1,1,1,1), true, false, ColorI(0, 0, 0, 255))
@/lua/ge/extensions/util/instancedLineRenderDemo.lua
drawgrid(gridSize, rot, origin + vec3(gridSize * 3, 0, z), true, width)
debugDrawer:drawText(origin + vec3(gridSize * 3, -0.5, z), String('grid line width = ' .. tostring(width)), ColorF(0, 0, 0, 1))
end
local txt = 'w = ' .. tostring(i) .. ', elements = ' .. tostring(elCount)
debugDrawer:drawText(pos, String(txt), ColorF(0, 0, 0, 1))
end
@/lua/common/utils/pixellib.lua
-- redneck text drawing function :D
function LuaPixelBuffer:drawText(pos, text, color)
text = string.upper(text)
pb:drawText(vec3(0, 200, 0), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', ColorI(0,0,0,255))
pb:drawText(vec3(0, 210, 0), '1234567890!?\'":,.-_', ColorI(0,0,0,255))
pb:drawText(vec3(0, 200, 0), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', ColorI(0,0,0,255))
pb:drawText(vec3(0, 210, 0), '1234567890!?\'":,.-_', ColorI(0,0,0,255))
pb:drawText(vec3(0, 220, 0), "Hello world!", ColorI(0,0,0,255))
pb:drawText(vec3(0, 210, 0), '1234567890!?\'":,.-_', ColorI(0,0,0,255))
pb:drawText(vec3(0, 220, 0), "Hello world!", ColorI(0,0,0,255))
@/lua/ge/extensions/flowgraph/nodes/environment/directionalGravity.lua
local grav = C.gConst * (self.planet.mass / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav)), ColorF(0,0,0,1))
end
@/lua/ge/extensions/util/vehicleRopeDebug.lua
local massText = string.format("%.3f kg", nodes[i].mass)
debugDrawer:drawText(nodes[i].pos, massText, ColorF(1.0, 0.7, 0.3, 1.0))
end
@/lua/ge/extensions/scenario/raceMarkers/sideMarker.lua
--debugDrawer:drawText(self.pos, String(string.format("%0.3f %s",t, self.blendState or "non")), ColorF(0, 0, 0, 1))
local a = 1
@/lua/ge/extensions/editor/missionStartPositionEditor.lua
local textColor = isSelected and ColorF(1, 1, 1, 1) or ColorF(1, 1, 1, 0.9)
debugDrawer:drawText(startPos, mission.id, textColor)
@/lua/ge/extensions/editor/gen/render.lua
-- print('?? label:'..tostring(s[2])..':'..tostring(s[1]))
debugDrawer:drawText(s[2], String(tostring(s[1])), c)
end
@/lua/ge/extensions/tech/techCore.lua
for _, line in pairs(debugObjects.text) do
debugDrawer:drawText(line.origin, line.content, line.color)
end
@/lua/ge/extensions/scenario/scenarios.lua
debugDrawer:drawSphere(pp, n.radius, ColorF(0.5,0.5,0.5,0.3))
debugDrawer:drawText(pp, String(tostring(nid)), ColorF(0,0,0,1))
end
@/lua/ge/extensions/editor/gen/network.lua
Render.circle(n.pos, n.r, clr, 4, true)
debugDrawer:drawText(n.pos, String(o), ColorF(0,0,1,1))
-- debugDrawer:drawLine(v[1], v[2], ColorF(1,1,1,1), 4)
-- debugDrawer:drawText(massCenter, 'MC', ColorF(1,0,0,1))
@/lua/common/extensions/networking/editorToolchain.lua
debugDrawer:drawSphere(npos, 0.1, sphereColor)
debugDrawer:drawText(npos, String(node.name), ColorF(0, 0, 0, 1))
end
@/lua/ge/map.lua
if node.junction then
debugDrawer:drawText(map.nodes[node1id].pos + vec3(0, 0, 2), node1id, black)
end
tmpPos:setAdd(map.nodes[node1id].pos)
debugDrawer:drawText(tmpPos, node1id, black)
end
tmpPos:setAdd(map.nodes[node2id].pos)
debugDrawer:drawText(tmpPos, node2id, black)
end
@/lua/ge/extensions/editor/camPathEditor.lua
if M.currentPath and path.id == M.currentPath.id then
debugDrawer:drawText(
marker.pos,
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veStaticRenderView.lua
if k % 2 == 0 then
debugDrawer:drawText(arrowVec, axisArrowTexts[k], ColorF(0.1,0.1,0.1,1))
end
@/lua/ge/extensions/scenario/raceMarkers/ringMarker.lua
--debugDrawer:drawText(self.pos, String(string.format("%0.3f %s",t, self.blendState or "non")), ColorF(0, 0, 0, 1))
--debugDrawer:drawLine(vec3(self.pos), vec3(self.pos + self.normal), ColorF(1,0,0,1))
@/lua/ge/extensions/flowgraph/nodes/environment/planet.lua
debugDrawer:drawSphere(center, self.pinIn.radius.value or 0, ColorF(0,0,1,0.1))
debugDrawer:drawText(center, String("Mass: " .. string.format('%0.2E', self.pinIn.mass.value or 0)), ColorF(0,0,0,1))
local grav = C.gConst * (self.pinIn.mass.value / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav).." | Dist: "..string.format('%0.2E', center:distance(vehPos)) ), ColorF(0,0,0,1))
end
@/lua/ge/extensions/core/ropeVisualTest.lua
local massText = string.format("%.3f kg", nodes[i].mass)
debugDrawer:drawText(nodes[i].pos, massText, ColorF(1.0, 0.7, 0.3, 1.0))
end
@/lua/ge/extensions/core/trafficSignals.lua
if self._invalid then
debugDrawer:drawText(self.pos, string.format('%s (ERROR)', self.name), debugColors.textError)
else
else
debugDrawer:drawText(self.pos, self.name, debugColors.textMain)
end
if showText then
debugDrawer:drawText(debugPos, string.format('state: %s', stateName or 'none'), debugColors.textMain)
end
@/ui/modules/options/options.js
function drawText(x, y, rot, yOffset, text, color) {
var rotInRad = degToRad(rot)
drawArrowRot(x, y, 100, 90, color)
drawText(x, y, 0, screenDepth, 'screen 2', color)
drawBoxRot(x, 50, 120, 120 / aspectRatio, 0, null, '#ff6b00')
drawArrowRot(x1, y1, 100, -a + 90, color)
drawText(x1, y1, -a, screenDepth, 'screen 1', color)
drawArrowRot(x2, y2, 100, a + 90, color)
drawText(x2, y2, a, screenDepth, 'screen 3', color)
drawBoxRot(x2, 50, 120, 120 / aspectRatio, 0, null, '#ff6b00')
@/lua/ge/extensions/editor/scriptAIManager.lua
local dbgTxt = ' ' .. activetxt .. tostring(vehId) .. ' - ' .. tostring(bo:getName()) .. ': ' .. statetxt
debugDrawer:drawText(p1, String(dbgTxt), ColorF(0, 0, 0, 1))
debugDrawer:drawLine(bo:getPosition(), p1, ColorF(0, 0, 0, 1))
@/lua/ge/extensions/editor/buildingEditor.lua
for o = 1,#anode do
debugDrawer:drawText(anode[o].pos, String(tostring(o)), ColorF(0,0,1,1))
end
@/lua/ge/extensions/editor/gen/world.lua
if l[2] then
debugDrawer:drawText(l[1], String(tostring(l[2])), ColorF(0,0,1,1))
end
@/lua/ge/extensions/editor/slotTrafficEditor.lua
if camNodeSqDist < square(clamp(editor.getPreference("gizmos.visualization.visualizationDrawDistance") * 0.5, 50, 250)) then
debugDrawer:drawText(n.pos, String(tostring(nid)), linkBaseColor)
end
@/lua/vehicle/bdebugImpl.lua
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawText(p + vec3(0, 0, 0.3), color(255, 0, 0, 255), string.format("COG (%0.3f, %0.3f, %0.3f)", relCOGPos.x, relCOGPos.y, relCOGPos.z))
local distToAlpha = nodeTextMaxDist < nodeTextMaxDistCap and (-1 / nodeTextMaxDist * (dist - nodeMinDistFromCam) + 1) or nodeTextMaxDistCap
obj.debugDrawProxy:drawText(pos, color(r,g,b, a * distToAlpha), txt)
--obj.debugDrawProxy:drawNodeText(i, col, txt, nodeDisplayDistance)
local function renderBeamText(pos, col, txt, entries)
obj.debugDrawProxy:drawText(pos, col, txt)
table.clear(entries)
groupPos:setScaled(1 / groupData[1])
obj.debugDrawProxy:drawText(groupPos, groupData[3], g)
end
groupPos:setScaled(1 / groupData[1])
obj.debugDrawProxy:drawText(groupPos, groupData[3], g)
end
@/lua/ge/extensions/scenario/raceDebug.lua
debugDrawer:drawSphere(pp, n.radius, ColorF(1,0,0,0.3))
--debugDrawer:drawText(pp, String("#" .. tostring(i) .. "/" .. #currentScenario.lapConfig ), ColorF(0,0,0,1))
local label = "wp " .. tostring(i) .. "/" .. #currentScenario.lapConfig
local label = "wp " .. tostring(i) .. "/" .. #currentScenario.lapConfig
debugDrawer:drawText(pp, String(label), ColorF(0,0,0,1),false)
end
@/lua/ge/extensions/gameplay/util/damageAssessment.lua
debugDrawer:drawText(worldPos, string.format("%i|%i", sectionDamageInfo.sectionBeamDamage, sectionDamageInfo.sectionCollisionDamage), magentaColor)
end