Beispiel #1
0
from FGAme import draw, conf
from time import sleep

# Render tree with circles
p0 = (400, 300)
tree = draw.RenderTree()
tree.add(draw.Circle(150, p0, color='red'))
tree.add(draw.Circle(120, p0, color='white'))
tree.add(draw.Circle(100, p0, color='red'))
tree.add(draw.Circle(70, p0, color='white'))
tree.add(draw.Circle(50, p0, color='red', linecolor='black', linewidth=10))

# Start screen
canvas = conf.init_screen(800, 600)
canvas.show()

# Main loop
for i in range(50):
    canvas.clear_background('white')
    canvas.draw(tree)
    canvas.flip()
    sleep(0.01)
Beispiel #2
0
from FGAme import conf
from FGAme import draw

screen = conf.init_screen(800, 600)
screen.show()

circle = draw.Circle(100, color='red')
screen.draw(circle)
screen.flip()


c1 = draw.Circle(50, pos=(400, 300), color='black')
c2 = draw.Circle(30, pos=(400, 300), color='white')
with screen.painting():
    screen.draw(c1)
    screen.draw(c2)
Beispiel #3
0
from FGAme import conf
from FGAme import draw

screen = conf.init_screen(800, 600)
screen.show()

circle = draw.Circle(100, color='red')
screen.draw(circle)
screen.flip()

c1 = draw.Circle(50, pos=(400, 300), color='black')
c2 = draw.Circle(30, pos=(400, 300), color='white')
with screen.painting():
    screen.draw(c1)
    screen.draw(c2)