MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / scale_brain

Function scale_brain

brainworkshop.py:4823–4834  ·  view source on GitHub ↗
(dt)

Source from the content-addressed store, hash-verified

4821 pos += (0,)
4822brain_graphic.position = pos
4823def scale_brain(dt):
4824 brain_graphic.scale = dt
4825 brain_graphic.x = field.center_x - brain_graphic.image.width//2 + scale_to_width(2) + (brain_graphic.image.width - brain_graphic.width) // 2
4826 brain_graphic.y = field.center_y - brain_graphic.image.height//2 + scale_to_height(60) + (brain_graphic.image.height - brain_graphic.height) // 2
4827 window.clear()
4828 brain_graphic.draw()
4829 if brain_graphic.width < 56:
4830 mode.shrink_brain = False
4831 pyglet.clock.unschedule(scale_brain)
4832 brain_graphic.scale = 1
4833 brain_graphic.position = (field.center_x - brain_graphic.width//2,
4834 field.center_y - brain_graphic.height//2 + 40)
4835
4836scale_brain(scale_to_width(1))
4837# If we had messages queued during loading (like from moving our data files), display them now

Callers 1

brainworkshop.pyFile · 0.85

Calls 4

scale_to_widthFunction · 0.85
scale_to_heightFunction · 0.85
clearMethod · 0.80
drawMethod · 0.45

Tested by

no test coverage detected