DrawText

Syntax

Parameters

Example

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

context:SetColor(0,0,1)
context:Clear()

--Draw some text centered on the screen
local text = "Hello!"

local font = context:GetFont()

local x = window:GetWidth()/2
local y = window:GetHeight()/2

x = x - font:GetTextWidth(text)/2
y = y - font:GetHeight()/2

context:SetBlendMode(Blend.Alpha)
context:SetColor(1,1,1)
context:DrawText(text,x,y)
context:SetBlendMode(Blend.Solid)

context:Sync()
end