Ejemplo n.º 1
0
#frame = Frame(window, sf.Rectangle(sf.Vector2(10, 10), sf.Vector2(400, 300)), title="frame")
layout = SelectionMenu(window, permanentActivation=True)
layout.spacing = sf.Vector2(10, 10)
box = CheckBox(window, sf.Rectangle(sf.Vector2(100, 100), sf.Vector2(50, 50)))
box2 = CheckBox(None, sf.Rectangle(sf.Vector2(20, 20), sf.Vector2(50, 50)))
box3 = CheckBox(None, sf.Rectangle(sf.Vector2(20, 20), sf.Vector2(50, 50)))
box4 = CheckBox(None, sf.Rectangle(sf.Vector2(20, 20), sf.Vector2(100, 100)))
box5 = CheckBox(None, sf.Rectangle(sf.Vector2(20, 20), sf.Vector2(100, 100)))
layout.addWidget(box, sf.Vector2(1, 0), sf.Vector2(1, 1))
layout.addWidget(box2, sf.Vector2(1, 1), sf.Vector2(1, 1))
layout.addWidget(box3, sf.Vector2(0, 2), sf.Vector2(1, 1))
layout.addWidget(box4, sf.Vector2(2, 1), sf.Vector2(1, 1))
layout.addWidget(box5, sf.Vector2(1, 1), sf.Vector2(1, 1))
layout.posOrigin = Position.Center
layout.pos = sf.Vector2(400, 300)
layout.setAllActiveMouseKeyboard(sf.Keyboard.RETURN, sf.Mouse.LEFT)
layout.canFocus = False
framer = list()

while window.is_open:
	window.update()
	if len(framer) >= 10:
		print(sum(framer)/10)
		framer.clear()
	framer.append(window.framerate)
#	progress.currentValue = slide.currentValue/50
#	progress2.currentValue = slide2.currentValue/50
#	progress3.currentValue = slide3.currentValue/50
#	progress4.currentValue = slide4.currentValue/50
#	progress5.currentValue = slide5.currentValue/50