5 import gfxprim
.core
as core
6 import gfxprim
.backends
as backends
7 import gfxprim
.gfx
as gfx
8 import gfxprim
.text
as text
9 import gfxprim
.input as input
14 black
= c
.RGBToPixel(0, 0, 0)
15 white
= c
.RGBToPixel(0xff, 0xff, 0xff)
19 align
= text
.C
.ALIGN_CENTER | text
.C
.VALIGN_CENTER
20 c
.text
.Text(None, c
.w
//2, c
.h
//2, align
, white
, black
, "Hello World!")
25 backend_string
= "X11:100x100"
27 if len(sys
.argv
) == 2:
28 backend_string
= sys
.argv
[1]
31 print("Usage: %s [backend init string]" % sys
.argv
[0])
34 # Create backend window
35 bk
= backends
.BackendInit(backend_string
, "Backend Example")
46 if (ev
.type == input.EV_KEY
):
48 elif (ev
.type == input.EV_SYS
):
49 if (ev
.code
== input.EV_SYS_QUIT
):
51 if (ev
.code
== input.EV_SYS_RESIZE
):
55 if __name__
== '__main__':