blob: bee78caf2e56e539f5e8536211cb7327cb765eb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
io.stdout:setvbuf("no")
local shader
local text
local page
local tf
function jin.core.onLoad()
local font_shader = jin.filesystem.read("font.shader")
shader = jin.graphics.newShader(font_shader)
local bitmap = jin.graphics.newBitmap("font2.png")
local tfdata = jin.graphics.newTTFData("font.ttf")
tf = tfdata:newTTF(15)
page = tf:typeset("this is a test", 16)
end
function jin.core.onEvent(e)
if e.type == "Quit" then
jin.core.stop()
end
end
function jin.core.onDraw()
jin.graphics.useShader(shader)
jin.graphics.print("this 你好 is a test", tf, 10, 10, 16)
jin.graphics.unuseShader()
end
|