diff options
Diffstat (limited to 'bin/main.lua')
-rw-r--r-- | bin/main.lua | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/bin/main.lua b/bin/main.lua index 590debe..338287a 100644 --- a/bin/main.lua +++ b/bin/main.lua @@ -4,6 +4,8 @@ local shader local text local page local tf +local sprites +local ttf function jin.core.onLoad() shader = jin.graphics.newShaderf("font.shader") -- local bitmap = jin.graphics.newBitmap("defaultfont.png") @@ -11,6 +13,11 @@ function jin.core.onLoad() -- tf = tfdata:newTTF(13) -- page = tf:typeset("this is a test") jin.graphics.setClearColor(100, 100, 100, 255) + local bitmap = jin.graphics.newBitmap("sprites.png") + sprites = jin.graphics.newTexture(bitmap) + bitmap = nil + local ttfdata = jin.graphics.newTTFData("font_pixel.ttf") + ttf = ttfdata:newTTF(22); end function jin.core.onEvent(e) @@ -39,35 +46,8 @@ function run() end function jin.core.onDraw() - jin.graphics.print([[ - ;:-_/|\!'"+=*()[]{}&% -function jin.core.onLoad() - shader = jin.graphics.newShaderf("font.shader") - -- local bitmap = jin.graphics.newBitmap("defaultfont.png") - -- local tfdata = jin.graphics.newTTFData("font.ttf") - -- tf = tfdata:newTTF(13) - -- page = tf:typeset("this is a test") -end -function jin.core.onLoad() - shader = jin.graphics.newShaderf("font.shader") - -- local bitmap = jin.graphics.newBitmap("defaultfont.png") - -- local tfdata = jin.graphics.newTTFData("font.ttf") - -- tf = tfdata:newTTF(13) - -- page = tf:typeset("this is a test") -end -function jin.core.onLoad() - shader = jin.graphics.newShaderf("font.shader") - -- local bitmap = jin.graphics.newBitmap("defaultfont.png") - -- local tfdata = jin.graphics.newTTFData("font.ttf") - -- tf = tfdata:newTTF(13) - -- page = tf:typeset("this is a test") -end -function jin.core.onLoad() - shader = jin.graphics.newShaderf("font.shader") - -- local bitmap = jin.graphics.newBitmap("defaultfont.png") - -- local tfdata = jin.graphics.newTTFData("font.ttf") - -- tf = tfdata:newTTF(13) - -- page = tf:typeset("this is a test") -end -]], 10,10) + jin.graphics.setColor(255, 255, 255) + jin.graphics.draw(sprites, 10, 10, 1, 1) + jin.graphics.setFont(ttf) + jin.graphics.print("this is a demo") end
\ No newline at end of file |