Created
March 25, 2015 13:54
-
-
Save G4MR/be9951d312bebebc8fbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include lib | |
var app = initApp("Example", 800, 600) | |
var img = Image() | |
#img.close() | |
var myfont = initFont( | |
"UTF8 Test ǽ Ǽ ǻ Ǿ", | |
20, | |
"OpenSans.ttf", | |
(0, 0, 255, 255), | |
render_type = "utf8", | |
text_type = "blendwrap", | |
wrap_length = 100 | |
) | |
app.after(proc(app: EAppMain) = | |
discard | |
) | |
app.before(proc(app: EAppMain) = | |
echo app.getTitle() | |
echo app.getWidth() | |
echo app.getHeight() | |
img.load("example.jpg", app.render) | |
) | |
app.close(proc(app: EAppMain) = | |
echo "Displays on close" | |
echo img.isLoaded() | |
img.close() | |
) | |
app.events(proc(app: EAppMain) = | |
discard #echo ($app.etype) | |
) | |
app.update(proc(app: EAppMain, dt: float) = | |
discard | |
) | |
app.draw(proc(app: EAppMain, render: RendererPtr) = | |
myfont.draw(render, 100, 100) | |
discard | |
) | |
app.setFps(30) | |
app.run() | |
#import typetraits | |
#echo name(type(mygame)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment