lovr-docs icon indicating copy to clipboard operation
lovr-docs copied to clipboard

2D Text Example

Open bjornbytes opened this issue 2 years ago • 0 comments

e.g.

function lovr.draw(pass)
  local width, height = pass:getDimensions()
  pass:setProjection(1, mat4():orthographic(width, height, -1, 1))
  pass:setViewPose(1, mat4())

  local font = lovr.graphics.getDefaultFont()
  font:setPixelDensity(1)

  pass:text('hi', width / 2, height / 2, 0, 1)
end

There is Window_HUD but it's not a small snippet like this

bjornbytes avatar Sep 10 '23 23:09 bjornbytes