bjornbytes / lovr-docs

Documentation for LÖVR
44 stars 35 forks source link

2D Text Example #132

Closed bjornbytes closed 6 months ago

bjornbytes commented 1 year ago

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 commented 6 months ago

2D Button does this