HelloWorld

From vx
Jump to: navigation, search

[edit] Hello World!

To do a simple program that displays "Hello world" on a black screen, here is the code:

require "vx"

function autoexec()
	local text = "Hello World"
	while true do
		vx.screen:RectFill(0, 0, vx.screen.width, vx.screen.height, vx.RGB(0, 0, 0))
		vx.default_font:Print(vx.screen.width / 2 - vx.default_font:TextWidth(text) / 2, vx.screen.height / 2, text)
		vx.ShowPage()
	end
end
Personal tools