#! /usr/bin/env python import xintwa Quit = False FONT="/usr/share/fonts/ttf-bitstream-vera/VeraMono.ttf" def QuitHandler(): global Quit Quit=True def KeyboardHandler(kb_ev): if kb_ev.state: global Quit Quit= True def LogFunc(l,x): print "[%i] %s"%(l,x) xintwa.init() events = xintwa.event.EventHandlers(key=KeyboardHandler,quit=QuitHandler) myFont = xintwa.font.FontPixmap(FONT) Textures = xintwa.ResourceManager(loader=xintwa.TextureByFilename('./')) # this line isn't required, and the concept may yet be removed xintwa.enable_logging(LogFunc) xintwa.set_video_mode(1024,768, title='xintwa test') xintwa.lower.ortho2d(-1,1,-1,bottom=1); x = xintwa.DQuad(1,1, texture=Textures.get("tempship.png")); c = xintwa.DQuad(1,1, texture=Textures.get("m-corner.png")); c.x = -0.5 start = xintwa.ticks() end = start + 2000 xintwa.lower.clear_screen( 0,0,0,1) x.draw() c.draw() for C in range(1,14): myFont.color = (C/13.0,C/13.0,C/13.0) myFont.size = C*3 myFont.write("hello",0,-1.0 +(C*0.1)) xintwa.swap_video_buffer() while 1: if Quit: break; events.process(); xintwa.quit()